in reply to Re: Getopt::Long good style?
in thread Getopt::Long good style?

I didn't understand the "hashy" part of GetOpt::Long yet, but it sounds good to me.

Regarding the
'h|help' => sub { help() },
part, I don't get the point. What's the advantage over:
'h|help' => \&help,

Replies are listed 'Best First'.
Re^3: Getopt::Long good style?
by naChoZ (Curate) on Jul 28, 2004 at 13:55 UTC

    That way is fine also. I tend to shy away from &'s in general out of personal preference.

    I just like...

    'h|help' => sub { help() }, ... sub help { ... }

    better than...

    'h|help' => \&help, ... my $help = sub { ... }

    --
    "A long habit of not thinking a thing wrong, gives it a superficial appearance of being right." -- Thomas Paine
    naChoZ