Mega Code Archive

 
Categories / Perl / System Functions
 

If the value is optional, use a colon

#Getopt::Long::GetOptions('number_copies:i' => \$copies); #!/usr/bin/perl -w use Getopt::Long; Getopt::Long::GetOptions(      'number_copies:i' => \$copies); if ( defined( $copies ) ) {     print "number_copies flag set to $copies\n"; }