sub test1 { my ($data) = @_; print "test1 data = $data\n"; } sub test2 { my $data = @_; print "test2 data = $data\n"; } test1("hello"); test2("hello"); test2( qw(hello world) ); OUTPUT: test1 data = hello test2 data = 1 test2 data = 2
In reply to function parameter assignment question by perlfan99
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |