Getopt::GetArgs - README
GetArgs needs to know
Using this information, GetArgs will create a hash of arguments for you to use throughout your subroutine.
Using GetArgs has several advantages:
sub WHATEVER {
my @DEFAULT_ARGS =
( Content => "Default content",
Verbose => 0
);
my %ARGS=GetArgs(@,@DEFAULTARGS); # do some stuff with $ARGS{Content} # show all kinds of detail if $ARGS{Verbose} }
# a simple call to WHATEVER
WHATEVER( "Just deal with my content" );
# a flexible call to WHATEVER
WHATEVER({ verbose => 1,
content => "This is my content",
});
See the t/*.t tests for additional examples.
Copyright (c) 2001, Rob Brown. All rights reserved. Getopt::GetArgs is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
$Id: README,v 1.1 2001/06/08 06:29:11 rob Exp $