Skip Menu |

This queue is for tickets about the Time-HiRes CPAN distribution.

Report information
The Basics
Id: 72926
Status: resolved
Priority: 0/
Queue: Time-HiRes

People
Owner: Nobody in particular
Requestors: anthony [...] derobert.net
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in:
  • 1.9719
  • 1.9721
Fixed in: (no value)



Subject: Time::HiRes::stat breaks list subscripting
Not completely sure if this is a bug in Time::HiRes (as opposed to perl itself). $ perl -MTime::HiRes -e 'print +(stat("foo"))[8], "\n"' # V1 1322915623 $ perl -MTime::HiRes=stat -e 'print +(stat("foo"))[8], "\n"' # V2 8 $ perl -MTime::HiRes=stat -e '@a = stat("foo"); print $a[8], "\n"' # V3 1322915623 The 8 being returned by V2 isn't right. In fact, you can put any sillyness you want in the list subscript: $ perl -MTime::HiRes=stat -e 'print +(stat("foo"))[JAPH], "\n"' JAPH It also isn't just a general bug with function calls, because this works: $ perl -e 'sub bar() { return qw(a b c d e f g h i j) }; print +(bar)[8], "\n"' i See also me asking this on Stack Overflow: http://stackoverflow.com/q/8367789/27727 This has been tested on: - Debian Perl 5.14.2-5 / 1.972101 - Debian Perl 5.10.1-17squeeze2 / 1.9719 - Gentoo Perl 5.14.2 (by cjm http://stackoverflow.com/a/8368432/27727) - Gentoo Perl 5.8.9 (by cjm http://stackoverflow.com/a/8368432/27727) - Gentoo Perl 5.10.0 (by cjm http://stackoverflow.com/a/8368432/27727)
Thanks for the report. It's definitely a bug in Time::HiRes, and affects any list-mode expression containing a call to Time::HiRes::stat(). Fixed in Time-HiRes-1.9725.