yucani has asked for the wisdom of the Perl Monks concerning the following question:
When hiding this sub in package and calling like thissub grabdataentry { my $href=shift; my %dhash=%{$href}; my $skey=shift; my $pos=shift; my @list=split /;/, $dhash{$skey}; return $list[$pos]; }
it does not work anymore. If the sub stays inside the caller package it works. Whats wrong?foreach my $key (sort { grabdataentry(\%hash,$a,0) cmp grabdataentry +(\%hash,$b,0) } keys %hash)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: hash ref package
by MidLifeXis (Monsignor) on Sep 14, 2012 at 18:01 UTC | |
by yucani (Initiate) on Sep 14, 2012 at 18:09 UTC | |
|
Re: hash ref package
by Anonymous Monk on Sep 14, 2012 at 21:11 UTC |