in reply to Parsing a hash into a sub
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) = @_;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Parsing a hash into a sub
by RaginElmo (Novice) on Jul 08, 2006 at 12:18 UTC |