I tried to placed ${date[0]}
in my directory which is equivalent to 01252010
but @hits
not printed. How can I managed to open the directory to get the desired output? Thanks.
ERROR: Unsuccessful open on filename containing newline at ./total.pl line 11, line 1.
#!/opt/perl/bin/perl -w
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;