in reply to Smart way to deal with cmdline Args?

1. first, you declare the variable 2. then, you pass it as Hash to the function that reads it .. 3. then, again deal with same variable in the usage()... Is there a way I have to deal with the variable just once??
Maybe foobar(\my %hash); or foobar(my $href = {...}); can get you part of the way there.

I only glanced at them, but you might make use of Getopt::ArgvFile (specifying files that are automatically read?) or Getopt::Lucid (which talks about reading in config file in its synopsis).

Replies are listed 'Best First'.
Re^2: Smart way to deal with cmdline Args?
by shail (Initiate) on Dec 08, 2010 at 17:29 UTC

    Great. Thanks. I am now using hash to collect values from options so I do not have to declare it explicitly so that makes it 2 dealings with options, rather than 3.

    I am going to look into other monks reply about pod2usage and see if helps me reduce two dealings to one.