Closed p5pRT closed 20 years ago
On Thu\, Nov 04\, 1999 at 09:43:28AM -0500\, John Amelia wrote:
When executing a perl script arguments such as perl_script file arg1 arg2 arg3 generate error messages.
Can't open arg1​: A file or directory in the path name does not exist\. Can't open arg2​: A file or directory in the path name does not exist\. Can't open arg3​: A file or directory in the path name does not exist\.
Here is a copy of the script ---
NV6KNCC cat do\_rshell\.pl \#\! /usr/local/bin/perl $rcmd = @​ARGV\[0\]; while\(\<>\) \{ chomp; $R = $\_; @​cmd = \("/u/t01bhjt/do\_router\_rshell"\, $R\, $rcmd\); system\(@​cmd\); \}
And what did you expect to get when you tried to open files that don't exist?
The input operator \<>\, when used without an explicit filehandle\, opens the files named in @ARGV in turn. Each element in @ARGV is treated as a filename. This is documented in perlop.
It appears that you need correct your script so that it does not treat the extra arguments as filenames.
Ronald
Migrated from rt.perl.org#1742 (status was 'resolved')
Searchable as RT1742$