in reply to Re: Using Getopt::Long to call subroutines
in thread Using Getopt::Long to call subroutines

Wow, clever, brilliant and simple. That is exactly what I was looking for, Thanks alot!.

Just to firm up my understanding:

unless ( @ARGV ) { exit sub1();

Does this code mean that unless an arguement is found in the command line it will run subroutine sub1 by default?

Also, I like your slogan.

Thanks

-mox

Replies are listed 'Best First'.
Re^3: Using Getopt::Long to call subroutines
by jdporter (Paladin) on Oct 22, 2006 at 13:32 UTC
    Does this code mean that unless an arguement is found in the command line it will run subroutine sub1 by default?

    Yes. Just what you asked for.

    Also, I like your slogan.

    Thanks! You can find a bit about the source of my "signature" on my homenode.

    We're building the house of the future together.
Re^3: Using Getopt::Long to call subroutines
by blazar (Canon) on Oct 22, 2006 at 16:25 UTC
    Just to firm up my understanding:
    unless ( @ARGV ) { exit sub1();
    Does this code mean that unless an arguement is found in the command line it will run subroutine sub1 by default?

    Yes, and as per exit's documentation, it will exit from your program with the value returned by sub1 (unless of course you exit earlier from within sub1) which may be what you want or not depending on what it actually does.