Greets,
I guess the title could also be "accessing implicit $_ in subroutine"...
I'm trying to reliably simulate say() in older Perl versions..
sub say { print @_, "\n"; } my @a = qw(1 2 3); # using implicit $_ does not work: say foreach (@a); # ...and of course explicit $_ works. say $_ foreach (@a); # works: say "uncle bob";
How can I get my say() subroutine to use the implied $_?
Thanks,In reply to Reliably simulating 5.10 say() by hlc
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |