in reply to Re: New to Perl
in thread New to Perl
To define %hash you need to map {$hash{$_}=1}@file_data
Did the querent update the OP? This works just fine (and is less abusive):
my %hash = map { $_ => 1 } @file_data;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: New to Perl
by rolandomantilla (Novice) on Aug 04, 2011 at 20:21 UTC | |
by chromatic (Archbishop) on Aug 04, 2011 at 22:19 UTC | |
by rolandomantilla (Novice) on Aug 06, 2011 at 04:00 UTC | |
by rolandomantilla (Novice) on Aug 06, 2011 at 05:40 UTC | |
by Anonymous Monk on Aug 06, 2011 at 06:23 UTC |