Ok, now I added the: my $regex = "^((?!total).)*\$";
I also removed the " " from the numbers in the if test: if ($array[6] >= 867580){ The error msg I get this time, is like this: r...@user# ./script.pl 0 Use of uninitialized value $array[6] in numeric ge (>=) at ./script.pl line 21, <$memory> line 3. Use of uninitialized value $array[6] in numeric ge (>=) at ./script.pl line 23, <$memory> line 3. 0 Use of uninitialized value $array[6] in numeric ge (>=) at ./script.pl line 21, <$memory> line 4. Use of uninitialized value $array[6] in numeric ge (>=) at ./script.pl line 23, <$memory> line 4. 0 I appreciate the help :)