merging two hashes together?

2001-11-03 Thread AMORE,JUAN (HP-Roseville,ex1)
Hello Perl Gurus, I'm trying to write a program that will merge two hashes together onto a third hash called %h3. I need to return a reference to %h3 to the main program and print each of the values of the hash %h3 using the arrow notation. Name of the actual function performing the merge

RE: merging two hashes together?

2001-11-03 Thread Wagner-David
one : 1 six : 6 three: 3 two : 2 Wags ;) -Original Message- From: AMORE,JUAN (HP-Roseville,ex1) [mailto:[EMAIL PROTECTED]] Sent: Saturday, November 03, 2001 10:09 To: Beginners@Perl. Org (E-mail) Cc: 'Maxim Berlin' Subject: merging two hashes together? Hello Perl

Re[2]: merging two hashes together?

2001-11-03 Thread Maxim Berlin
Hello Wagner-David, Saturday, November 03, 2001, Wagner-David [EMAIL PROTECTED] wrote: WD Here is one shot, though I changed some of the constants: WD #!perl -w my %h1 = (one = 1, two = 2, three = 3); my %h2 = (four = 4, five = 5, six = 6); WD my %h3 = (); WD mergehash( \%h1,

Re: merging two hashes together?

2001-11-03 Thread Dave Storrs
In the example you provide, this will work: -START %h1 = (one = 1, two = 2, three = 3); %h2 = (four = 4, five = 5, six = 6); # Note that the '' on function calls is optional, unlike $, @, and % $ref_h3 = mergehash(_, _); sub mergehash { my ($rh_first,