I tried to place ${date[0]}in my directory, which is equivalent 01252010, but @hitsnot printed. How did I manage to open the catalog to get the desired result? Thank.
ERROR: Could not open file name containing new line string. /total.pl, line 1, line 1.
use strict;
open(FH,"/home/daily/scripts/sms_hourly_stats/date.txt");
my @date = <FH>;
print $date[0];
my $path = "/home/daily/output/sms_hourly_stats/${date[0]}/TOTAL.txt";
open(FILE,"$path") or die "Unable to open $path: $!";
my @hits = <FILE>;
print @hits;
close FH;
close FILE;
source
share