in reply to Re^2: Reading through a file and checking for a specific string
in thread Reading through a file and checking for a specific string

Yes, you have, but there are still some there.
You still have a single quote without it's corresponding part here

@files = glob ('/export/home/date_file*); ^ ^<-- not there
Then instead of these
 $counts[$i] ...
$files[$i]..
$counts[$i]++..
you are writing  @counts[$i] ...
@files[$i]..
@counts[$i]++.. Which in this case is not correct.

If I may give you a head up ( it might not be the best suited for you but it might point you in a right direction ).
I have a few text file in a directory, and am reading each file to see how many times some certain words were used like this:
use warnings; use strict; use Data::Dumper; my %type; @type{qw(is a an at)} = (0) x 4; for my $file ( glob "*.txt" ) { open my $fh, '<', $file or die $!; while (<$fh>) { for (split) { $type{$_}++ if exists $type{$_}; } } } print Dumper \%type; my $total = 0; $total += $type{$_} for keys %type; print $total, $/;

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me