shift returns a single element of @_ (i.e. the first element), whereas you (presumably) want all parameters of getInfo except the first to go into %thehash. You can do that like this:my $thescalar=shift; my %thehash=shift;
or evenmy $thescalar = shift; # 1st parameter goes in $thescalar my %thehash = @_; # everything else goes in %thehash
my ($thescalar, %thehash) = @_;
In reply to Re: Parsing a hash into a sub
by Arunbear
in thread Parsing a hash into a sub
by RaginElmo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |