in reply to Different hashes?
This is my modify code:$VAR1 = { 'WaterSports' => [ '8765', [ 'Drysuit', 'r', 'M-L' ] }; $VAR1 = { 'WaterSports'=> [ '8765', [ 'Drysuit', 'r', 'M-L' ] '8365', [ 'Paddle', 't', '45' ] ] };
I also tried thisopen(INFILE, "products-id.txt")|| die "Cannot open products-id.txt fil +e"; open (OUTPUT,">$output") or die ("Can't open file $output $!"); chomp(my @ProductArray = map { /^\s*$/ ? () : $_ } <INFILE>); close (INFILE); foreach my $line(@ProductArray) { my ($Category, $ID, $Name, $Type, $Size) = split( / /, $line ); push(@{$AllProducts{$Category}}, $ID, [$Name, $Type, $Size]); print OUTPUT Dumper(\%AllProducts); }
Thankspush @{$AllProducts{$Category}}, ($ID, [$Name, $Type, $Size]);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Different hashes part II
by Anonymous Monk on Mar 26, 2004 at 16:50 UTC | |
by Anonymous Monk on Mar 26, 2004 at 17:15 UTC | |
|
Re: Different hashes part II
by graff (Chancellor) on Mar 26, 2004 at 17:21 UTC |