On Jul 26, Mooney Christophe-CMOONEY1 said:

>@b=qw/-x 24 -y 25 -z 26/;
>
>Is there a nice way to merge the hash implied by @b into %a to get

  while (@b) {
    my ($k, $v) = splice @b, 0, 2;
    $a{$k} = $v;
  }

You could write

  %a = (%a, @b);

but that's potentially slow and ugly.

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
I am Marillion, the wielder of Ringril, known as Hesinaur, the Winter-Sun.
Are you a Monk?  http://www.perlmonks.com/     http://forums.perlguru.com/
Perl Programmer at RiskMetrics Group, Inc.     http://www.riskmetrics.com/
Acacia Fraternity, Rensselaer Chapter.         Brother #734
**      Manning Publications, Co, is publishing my Perl Regex book      **


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to