in reply to Re^2: question about getopt
in thread question about getopt

You can always write that more tidily:
my $source_file = $options{o} || 'as.xcf-dist'; my $config_file = $options{c} || 'config.ini'; my $dest_file = $options{x} || usage();

Another possibility is to use Getopt::Long, which IMHO has a nicer API.

Replies are listed 'Best First'.
Re^4: question about getopt
by BioLion (Curate) on Jun 24, 2009 at 09:03 UTC

    Not just IYHO...
    Tk::Getopt uses the Getopt::Long API and makes it easy to knock up a simple GUI with loading/saving of options and setting defaults too... You can also override the gui part if you want to take options directly from the commandline

    Just a something something...