http://www.perlmonks.org?node_id=980709


in reply to Perl Input Parameters for Unix

See if Getopt::Std or Getopt::Long work for you. First recipe here in the cookbook (15.1)

Replies are listed 'Best First'.
Re^2: Perl Input Parameters for Unix
by frozenwithjoy (Priest) on Jul 09, 2012 at 16:00 UTC
    OP: Different people prefer different approaches, but I recommend Getopt::Long over Getopt::Std, et al. I like being able to use more than just a single letter for the flags to increase readability. Also, you can still abbreviate to a single letter (or unique fragment) to reduce typing when calling the script from the CLI. Another tip: you can set default, overridable values by defining (rather than just declaring) before the Getopts block for whichever variables you want defaults.