in reply to Re: Dynamic array names
in thread Dynamic array names
my %serviceHash;
while (<INPUT>) {
/^(\d*)\.(\d*)\:(\S*)$/;
if ( !defined( $serviceHash{ $1 } ) ) {
my @array = ();
$serviceHash{ $1 } = \@array;
}
$($serviceHash{ $1 })[ $2 ] = $3;
}
You can then do a foreach over the keys of the hash, and do the necessary processing from there.
(Update: damn those gt and lt's!)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re (tilly) 3: Dynamic array names
by tilly (Archbishop) on Feb 10, 2001 at 07:55 UTC |