> I'm not actually printing $_ but doing some more parsing, I wanted to keep
> the example short.
use Data::Dumper;
my %jobs;
while ( ) {
/(\d\d\d\d)/ && push @{$jobs{$1}}, $1;
}
print Dumper \%jobs;
__DATA__
|-
|JT# |
||
|1780|
|1776|
|1781|
|1778|
|1785|
|1787|
|1788|
|178
Thanks for an excellent alternative.
What about if I wish to keep duplicate values? (my fault for not supplying
sample data that way, sorry).
I'm not actually printing $_ but doing some more parsing, I wanted to keep
the example short.
thanks
jpf
___
Per
The warning you are getting results from the way that $count is incremented
inside of your while loops. You have 12 valid entries in in.txt, so:
$high = 11.
The last time that:
$num eq $sorted[$count]
will return true is when $count is 11. Consequently, $count is incremente
-start-
> Jean-Paul Felix <[EMAIL PROTECTED]>
>at03/02/2001 01:31 PM
>I think one of the variables is referenced past any allocated values. I
have
>to ignore lines that are not a four figure number. If there's a cleaner
way
>to do this I'd be very grateful.
>thanks all.
#!perl.exe -w
ope