Try just
%data = (%one, %two, %three, %four);
you haven't got any duplicate key names have you??
John
-----Original Message-----
From: Chris Rutledge [mailto:[EMAIL PROTECTED]]
Sent: 27 July 2001 13:56
To: [EMAIL PROTECTED]
Subject: 4 hashes into 1 hash
Hello all,
Here's what I have......4 single dimension hashes that I'm trying to
use to populate a single hash (single dimension)
with...
%data = return_hash( %one, %two, %three, %four );
sub return_hash
{
my ( %one, %two, %three, %four ) = @_;
my ( $data );
for (keys(%one))
{
$data{$_} = $one{$_};
}
for (keys(%two))
{
$data{$_} = $two{$_};
}
for (keys(%three))
{
$data{$_} = $three{$_};
}
for (keys(%four))
{
$data{$_} = $four{$_};
}
return (%$data);
}
If this is not the correct way to do so please let me know. Am I
clearing the "data" hash for each for loop? I do thank you for your time.
Thanks in advance,
Chris
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------Confidentiality--------------------------.
This E-mail is confidential. It should not be read, copied, disclosed or
used by any person other than the intended recipient. Unauthorised use,
disclosure or copying by whatever medium is strictly prohibited and may be
unlawful. If you have received this E-mail in error please contact the
sender immediately and delete the E-mail from your system.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]