Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I am getting an output ofwhile (<FILE>) { chomp; my ($key, $rest) = split /-/; push @{$hash{$key}},$rest; } $l=14178439; @values= exists $hash{$l}? @hash{$l}:undef; { print "\n Hash Value of 14178439 : @{$hash{$l}} \n"; }
when the actual value isHash Value of 14178439 : 2,3242342,2343242 3,234432,123123 2,34343
plz tell y this is happening?Hash key :14178439 Hash Val:2,34343,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: conditional exists
by JavaFan (Canon) on Jul 08, 2009 at 10:21 UTC | |
|
Re: conditional exists
by jethro (Monsignor) on Jul 08, 2009 at 11:29 UTC | |
by Anonymous Monk on Jul 08, 2009 at 12:48 UTC | |
by jethro (Monsignor) on Jul 08, 2009 at 12:56 UTC |