Hello Monks, I am extracting a file name from a string and trying to open this file but i get error no such file or directory.
my $run_cmd = "./tpsm -rules tpsm_rulesfile_ubuntu -looprf 0 -stop 10 + -pspc 1 >logfile.txt "; # I extract logfile.txt from this string my ( $logfile ) = ( split />/,$run_cmd )[-1]; chomp($logfile); my $pagal = "$rundir_path/$logfile"; # this doesn't work-- case1 my $pagal = "$rundir_path/logfile.txt"; # this works fine -- case 2 open ( my $fh,"<",$pagal ) or die "No such logfile found\n";
case 1 it doesn't work and case-2 it works , i tried printing the two cases they were exactly the same. Please help
In reply to open file error by t-rex
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |