Subject: | await can sometimes corrupt @_ |
Given the function:
async sub read_reg
{
my $self = shift;
my $reg = shift;
print STDERR "ENTER BNO055 read_reg snail=<@_>\n";
... some code here involving await
print STDERR " now snail=<@_>\n";
...
}
Sometimes this runs fine, but sometimes the value of @_ gets corrupted:
ENTER BNO055 read_reg snail=<8 forcecache>
now snail=<8 forcecache>
(correct)
ENTER BNO055 read_reg snail=<4 forcecache>
now snail=<Future=HASH(0x555556458bd0)>
(wrong)
I don't have an exact minimal test case yet as the real code involves layers of Device::Chip + Device::BusPirate + Future::IO, but a difference appears to be whether the inner code invoked by the await itself uses F-AA
--
Paul Evans