X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fgetopts.pl;h=ec1012a865a3fc211e5c8571ad78159b40ccf317;hb=b41aadf259cf55858c5ab0386356cdbe2dc49a6b;hp=4a50b8f6c22489fcf9e6378ef87a95ef9d7b2afe;hpb=a60e505a41cfa0425b60ae64a2076d7cebcdc0b3;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/getopts.pl b/lib/getopts.pl index 4a50b8f..ec1012a 100644 --- a/lib/getopts.pl +++ b/lib/getopts.pl @@ -7,7 +7,11 @@ # programming techniques. # # Suggested alternatives: Getopt::Long or Getopt::Std -# + +warn( "The 'getopts.pl' legacy library is deprecated and will be" + . " removed in the next major release of perl. Please use the" + . " Getopt::Long or Getopt::Std module instead." ); + ;# Usage: ;# do Getopts('a:bc'); # -a takes arg. -b & -c not. Sets opt_* as a ;# # side effect. @@ -31,7 +35,7 @@ sub Getopts { } eval " push(\@opt_$first, \$rest); - if(\$opt_$first eq '') { + if (!defined \$opt_$first or \$opt_$first eq '') { \$opt_$first = \$rest; } else {