Programming Languages
C
Subjective
Mar 15, 2013
If you want to read command-line arguements with Perl. How would you do that?
Detailed Explanation
In Perl, command line arguments are stored in an array @ARGV. Hence $ARGV[0] gives the first argument $ARGV[1] gives the second argument and so on. $#ARGV is the subscript of the last element of the @ARGV array, so the number of arguments on the command line is $#ARGV + 1.
Discussion (0)
No comments yet. Be the first to share your thoughts!
Share Your Thoughts