my $proph=@_;
Using an array (here @_) in scalar context returns the number of elements in the array , and is not what you want.
Typical solutions are (use only one of them)
my $proph = shift; # defaults to @_ my ($proph) = @_; # list context instead my $proph = $_[0]; # be explicit about wanting the first element
See perlintro and perlsub for more details.
In reply to Re: passing variables to a subroutine
by moritz
in thread passing variables to a subroutine
by AWallBuilder
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |