in reply to Re: from array to hash
in thread from array to hash
all values of %b are erased using map.....#! /usr/bin/perl @a = qw(a b c d ); $b{x} = 10 ; %b = map { $_, 1} splice(@a, 0, scalar(@a) ); print "$_ --> $b{$_}\n" foreach (keys %b) ;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: from array to hash
by friedo (Prior) on Mar 09, 2006 at 15:48 UTC | |
|
Re^3: from array to hash
by ikegami (Patriarch) on Mar 09, 2006 at 17:20 UTC |