Hi All,
I am creating a small per script but I am getting the error "Unable to open file because No such file or directory".My code is below.I am trying to go into the below location so using chdir and then seraching the log files of below pattern.
#!/usr/bin/perl -w
chdir '/projects/stp/stpbuild/logs/BuildLogs/';
$a = `ls -ltr | grep STP-201211`;
open (TEMP, "$a") || die "Unable to open file $a because $!\n";
@files = (<$TEMP>);
foreach $file (@files) {
print $file . "\n";
}