NodeReaper has asked for the wisdom of the Perl Monks concerning the following question:

This node was taken out by the NodeReaper on Mar 12, 2009 at 17:16 UTC
  • Comment on Reaped: Getopt::Long. forms => sub { push( @actions, \&dump_forms ); },

Replies are listed 'Best First'.
Re: Getopt::Long. forms => sub { push( @actions, \&dump_forms ); },
by bellaire (Hermit) on Mar 12, 2009 at 11:23 UTC
    From the look of those options, I'd say they don't take any parameter. Rather, they specify actions that you want to take place, and put them on the list of @actions. Later on, you can iterate over @actions and execute each subroutine ref.

    So, if you say ./mygetopt3.pl --forms --images, you are simply specifying that you want your scipt to run its dump_forms and dump_images subroutines. From their names, those subroutines probably just dump a list of items for the user to view.

    UPDATE: I guess I should've checked first, there are much more in-depth answers in the responses to your original post.
Re: Getopt::Long. forms => sub { push( @actions, \&dump_forms ); },
by Anonymous Monk on Mar 12, 2009 at 11:29 UTC