my @things = 1.. 5; display_thing() foreach @things; sub display_thing { my $t = $_; print $t }
works fine. If you really want to call display_thing without the brackets either declare the subroutine before you call it, or use prototypes (but you don't want to do that, honest).
In reply to Re: Is it possible to write a sub that understand default variables ?
by FunkyMonk
in thread Is it possible to write a sub that understand default variables ?
by bcarnazzi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |