When I compile and run the following script: print "What is your name?\n"; When I try to compile and run with the command: perl filename.pl 0 1 I get the following messages in the terminal.
Can't open 0: No such file or directory at commandline_error.pl line 2.
$name = <>;
#chomp($name);
print $ARGV[0],$ARGV[1],"\n";
print "Your name is ",$name;
Can't open 1: No such file or directory at commandline_error.pl line 2.
I believe the compiler is assuming 0 and 1 as filenames rather than command line arguments. I would like to know how to make sure that compiler treats them as command line arguments and not as filenames. I am a beginner in Perl. Any pointers would be greatly appreciated.