in reply to open file error
Note that when you use split, your variable will have a space at the end. You can find that by printing the values:
print "[$pagal]\n";
In the case that does not work, you will find that there is the additional space from $run_cmd.
Personally, I would restructure the code so that the log file is in a separate variable from the start:
my $logfile = '/tmp/some/logfile.txt'; my $run_cmd = "... >$logfile"; ... open my $log, '<', $logfile or die "Couldn't open log file '$logfile': $!";
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: open file error
by t-rex (Scribe) on Jul 19, 2016 at 10:57 UTC | |
by Corion (Patriarch) on Jul 19, 2016 at 11:02 UTC | |
by t-rex (Scribe) on Jul 19, 2016 at 11:59 UTC |