and why you can only return one value from a subroutine?
You can return as many values as you like from a sub in list context. How do you think split etc work?
why perl uses references to pass arrays?
Because it's easier... and more efficient. It's also the best way to return multple arrays from a sub... return \@a1, \@a2;
UPDATE: just noticed that you have not QUOTED your array values... and values is a perl keyword!
In reply to Re: I've read perlref
by maa
in thread I've read perlref
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |