#!/usr/bin/perl use Data::Dumper; my %products; while (defined( $_ = <DATA> )){ next if $. <= 2 || /^\s*$/; my @d = split ' '; my $cat = shift @d; my $id = shift @d; push @{$products{$cat}}, [ $id, \@d ]; } print Dumper(\%products); __DATA__ Category ID Name Type Size ======================================= WaterSports 8765 Drysuit r M-L WaterSports 8365 Paddle t 45 WinterSports 5231 Snowboard j 85 WinterSports 5281 Gloves r S
In reply to Re: Different hashes?
by borisz
in thread Different hashes?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |