Jaapx has asked for the wisdom of the Perl Monks concerning the following question:
I want to pass two hashes and a scalar to a subroutine and do a little work with them. Problem I'm getting is that the passed hashes don't seem to be recognized, as in, the if statement gives a "use of uninitialized value". Do you guys have any idea how to pass the hashes so that you can edit them? Many Thanks.
sub count_orientation($ \% \%){ my $ref = shift; my %x = %{(shift)}; my %y = %{(shift)}; $x{$ref}{amount}++; if ($y{$ref}{orientation} eq "for"){ $x{$ref}{amountFor}++; } else { $x{$ref}{amountRev}++; } } &count_orientation ($ref_end, %error_start, %score);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: passing multiple hashes to a subroutine
by Sewi (Friar) on Oct 19, 2011 at 12:32 UTC | |
|
Re: passing multiple hashes to a subroutine
by Anonymous Monk on Oct 19, 2011 at 12:17 UTC | |
|
Re: passing multiple hashes to a subroutine
by AnomalousMonk (Archbishop) on Oct 19, 2011 at 19:46 UTC | |
|
Re: passing multiple hashes to a subroutine
by anneli (Pilgrim) on Oct 20, 2011 at 21:13 UTC | |
|
Re: passing multiple hashes to a subroutine
by itsscott (Sexton) on Oct 20, 2011 at 19:26 UTC |