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

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re: Can anyone please to modify this perl code
by redhotpenguin (Deacon) on Jun 02, 2005 at 04:52 UTC
Re: Can anyone please to modify this perl code
by thcsoft (Monk) on Jun 02, 2005 at 04:38 UTC
    just RTFM and give your own brain a try. ;)

    language is a virus from outer space.
Re: Can anyone please to modify this perl code
by ikegami (Patriarch) on Jun 02, 2005 at 04:43 UTC

    How do you like the following:

    #!/usr/bin/perl use strict; use warnings; use Pod::Usage qw( pod2usage ); use Getopt::Long qw( GetOptions ); sub program_options { my ($options) = @_; GetOptions( 'help' => \{$options->{help}}, 'verbose' => \{$options->{verbose}}, 'name:s' => \{$options->{name}}, ) or die "Couldn't read command line options"; my @errors; push @errors, "Input is required\n" unless $options{name}; pod2usage(@errors) if @errors; if (@errors || $options{help}) { pod2usage(<<'__EOI__'); Usage: To execute: perl ProgramName <argument> Help: perl ProgramName --help or perl ProgramName --h __EOI__ die("\n"); } } # Get command line options my %options; program_options(\%options);
      Hi
      Thanks a lot for your help.
      Regards, Sur