qball has asked for the wisdom of the Perl Monks concerning the following question:
my %hash; open (DATA, "<data.csv") or die "Can't open file $!\n"; my @DATA = <DATA>; close (DATA); foreach my $rec (@DATA) { chomp $rec; my @vars = split(/,/,$rec); if ($vars[0]) { map $_ =~ s/\s+$//g, @vars; #hash3 used for comparing comp_name values $hash3{$vars[2]} = (@vars[0,1]); #add 1,2,3 as needed } } foreach my $alias (keys %hash3) { print "The members of $alias are\n"; foreach (@{$hash3{$alias}}) { print "\t$_\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Values not printing.
by ton (Friar) on Apr 13, 2001 at 00:49 UTC | |
by sierrathedog04 (Hermit) on Apr 13, 2001 at 02:07 UTC | |
by qball (Beadle) on Apr 13, 2001 at 00:53 UTC | |
by ton (Friar) on Apr 13, 2001 at 01:11 UTC | |
|
Re: Values not printing.
by qball (Beadle) on Apr 13, 2001 at 19:14 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |