3 ms·
I thought `Whatever` was a joke, and had to go look it up on CPAN (http://search.cpan.org/~asg/Whatever-0.21/lib/Whatever.pm http://search.cpan.org/~asg/Whateve
by JadeNB 15y ago
I thought `Whatever` was a joke, and had to go look it up on CPAN (http://search.cpan.org/~asg/Whatever-0.21/lib/Whatever.pm http://search.cpan.org/~asg/Whatever-0.21/lib/Whatever.pm). Not to belabour a joke, but the examples there suggest that the map should be
map( $* ** 2 )
not
map( &_ ** 2 )
- draegtun 15y agoNo it's quite a serious & well written module. Hopefully it will become part of perl5i - https://metacpan.org/module/perl5i https://metacpan.org/module/perl5i &_ is an explicit $_ You use $* or &* when you need to check $_[0] first. So &_ is more correct with general map but $* (and &*) will work also in this autobox example (in fact i had used it in my first edit but preferred aesthetics of &_ especially with previous usage of $* only being deprecated in 5.10). NB. Above in code just for aesthetics!