in reply to Suggestions on how to make array of hashes with this...
Thanks guys.
... while ( <CDB> ) { chomp; die("$base failed probably due to the X25 link being saturated rig +ht now.\n". "Try again in a moment...". "Dump from $script: $!\n\n") if ( /ERROR/ ); next if ( /-/ ); if ( /AMA/ or /STATUS/ ) { $_ =~ s/\|//; if ( /\w/ ) { if ( $c == 3 ) { push(@ARRAY,{%SITREP}); $c = 0; } else { for ( split(/\|/) ) { $_ =~ s/\s//; ($param,$value) = split(/:/); $value =~ s/\s+//g; $SITREP{$param} = $value; $c++; } } } } } print "There are ".scalar @ARRAY." values in \@ARRAY\n"; #print "$ARRAY[0]{AMAFILE}\n"; <- example for my $element ( 0 .. $#ARRAY ) { for my $key ( keys(%{ $ARRAY[$element] }) ) { print "$element $role is $ARRAY[$i]{$key}\n"; } } sub debug { my $msg = "@_"; print STDERR "$msg" if DEBUG; }
----------
- Jim
|
|---|