Alternatively just read them all in as one big hash inyour sub if you know the keys are unique to each other ..
On Thu, Nov 15, 2001 at 11:53:47AM -0600, Tomasi, Chuck shaped the electrons to read: > Perl 5.6.0 > Sun Solaris 2.7 > > I'd like to send two or more associative arrays (hashes) to a sub. It looks > like the first one makes it but the values of the second never get passed. > Am I doing something wrong or is there a better way to do this (I'm hoping > you don't say by reference or I'll have to setup a lot of temporary hashes > to pass one or two key/value pairs on second, third, and fourth args) > > --------------Code---------------------- > #/usr/local/bin/perl -w > > use strict; > > sub phash > { > my (%hash1, %hash2) = @_; > > print "val1 = $hash1{'val1'}\n"; > print "val2 = $hash2{'val2'}\n"; > } > > my %h1 = ( val1 => 56 ); > my %h2 = ( val2 => 45 ); > > &phash(%h1, %h2); > ----------------output-------------------- > $ perl mhash.pl > val1 = 56 > val2 = > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]