Perl Programming Page 3 - Processing Command Line Options with PERL |
Now, with the hard sell out of the way, let's get down to the nitty-gritty of how Getopt::Long.pm works. Consider the following simple example:
Now, try running this code as is:
And then try running it after adding a "--debug" command-line option:
As you can see, the Perl code now recognizes the "--debug" flag on the command line, and sets a Boolean variable to true within the script.
blog comments powered by Disqus |