in reply to ask about array and hash
#!/usr/bin/perl -w use strict; my @array = qw(a b c d e f g); my %hash = ( '1st' , 'a', '2nd' , 'b', '3rd' , 'c', ); while (<@array>) { print; } foreach my $key (sort keys %hash) { print "$key: $hash{$key}\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(crazyinsomniac) Re^2: ask about array and hash
by crazyinsomniac (Prior) on Jan 17, 2002 at 10:01 UTC | |
by xtype (Deacon) on Jan 17, 2002 at 10:27 UTC | |
by crazyinsomniac (Prior) on Jan 17, 2002 at 10:50 UTC |