There's more than one way to do things | |
PerlMonks |
Re: Using 'Shift' in subroutine argumentby sen (Hermit) |
on Nov 02, 2007 at 10:54 UTC ( [id://648621]=note: print w/replies, xml ) | Need Help?? |
Hi, A subroutine's arguments come in via the special @_ array. The shift without an argument defaults to @_. for example, sub emp { $name = shift; $id = shift; print "name, $name, id $id"; } &emp('abc', 10);
In Section
Seekers of Perl Wisdom
|
|