This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
untodo the no-longer-failing todo test for rgs' patch
[perl5.git]
/
lib
/
getopts.pl
diff --git
a/lib/getopts.pl
b/lib/getopts.pl
index
4a50b8f
..
ec1012a
100644
(file)
--- a/
lib/getopts.pl
+++ b/
lib/getopts.pl
@@
-7,7
+7,11
@@
# programming techniques.
#
# Suggested alternatives: Getopt::Long or Getopt::Std
# 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.
;# 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);
}
eval "
push(\@opt_$first, \$rest);
- if
(
\$opt_$first eq '') {
+ if
(!defined \$opt_$first or
\$opt_$first eq '') {
\$opt_$first = \$rest;
}
else {
\$opt_$first = \$rest;
}
else {