Consider:
use strict; use warnings; my @powers = map{undef} 0 .. 3; my $x = 2; powers ($x, @powers); print("$x @powers\n"); sub powers { $_[$_] = $_[$_ - 1] * $_[0] for 1 .. @_ - 1; }
Prints:
2 4 8 16 32
Perl effectively passes parameters by reference. Arrays and hashes get flattened so each element becomes a parameter.
In reply to Re: Text::ExtractWords exhibits incomprehensible behavior?
by GrandFather
in thread Text::ExtractWords exhibits incomprehensible behavior?
by ibm1620
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |