Smith, Derek wrote:
: My hash creations are not working as I expected: %hash = ( @mir,
: @mir2 );
:
: Why?
Because nothing magical happens on the right hand side of the
assignment. If I have a series of arrays over there perl flattens
them into one list. It does not handle them special just because
there's a hash on the right hand side.
If @mir = (1, 2 ,3) and @mir2 = (4, 5, 6),
then ( @mir, @mir2 ) = (1, 2, 3, 4, 5, 6)
So using a little algebra,
my %hash = ( @mir, @mir2 );
Is the same as this:
my %hash = (1, 2, 3, 4, 5, 6);
Or similar to this:
my %hash = (
1 => 2,
3 => 4,
5 => 6,
);
HTH,
Charles K. Clarkson
--
Mobile Homes Specialist
Free Market Advocate
Web Programmer
254 968-8328
If it looks wrong convert it to plain text.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>