in reply to $ARGV[0] meaning

Howdy grewal, and welcome back again to the Monastery! Although all (Perl-related) questions are welcome in the Monastery, I'd like to submit that you could've saved yourself the trouble of having to post this one by using your favorite Internet search engine to search for "perl $ARGV[0]".

The first hit for me is this page, which says (right near the top):

Perl automatically provides an array called @ARGV, that holds all the values from the command line.

And if that's not enough (say, because you're not familiar with Perl's use of sigils like @ and $), it also explicitely says this a little further down:

If you expect a single value on the command line you can check what was it, or if it was provided at all by looking at $ARGV[0]. If you expect two variables you will also check $ARGV[1]

You might've gotten different results for your search, but I'm sure you would've found something to answer this question very quickly.

Just a tip for next time!

Replies are listed 'Best First'.
Re^2: $ARGV[0] meaning
by Anonymous Monk on Mar 30, 2018 at 00:00 UTC
    I understand your position, but as someone who did just google perl ARGV, this was the first page to show up for me. So it's not so bad that they asked.