From: Chip Salzenberg Date: Fri, 21 Feb 1997 16:41:00 +0000 (+1200) Subject: Avoid $` $& $' in libraries X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f02a87dff8d75d4e8d0bada37f4abde41184909e;p=p5sagit%2Fp5-mst-13.2.git Avoid $` $& $' in libraries (this is the same change as commit 2724d5068a405436d3f2cd00aeb8f7b460b24fec, but as applied) --- diff --git a/lib/Getopt/Long.pm b/lib/Getopt/Long.pm index f2b37e9..fccdf9b 100644 --- a/lib/Getopt/Long.pm +++ b/lib/Getopt/Long.pm @@ -14,7 +14,7 @@ require Exporter; @ISA = qw(Exporter); @EXPORT = qw(&GetOptions $REQUIRE_ORDER $PERMUTE $RETURN_IN_ORDER); -$VERSION = sprintf("%d.%02d", '$Revision: 2.6 $ ' =~ /(\d+)\.(\d+)/); +$VERSION = sprintf("%d.%02d", '$Revision: 2.6001 $ ' =~ /(\d+)\.(\d+)/); use vars qw($autoabbrev $getopt_compat $ignorecase $bundling $order $passthrough $error $debug $REQUIRE_ORDER $PERMUTE $RETURN_IN_ORDER @@ -530,7 +530,7 @@ sub GetOptions { # than once in differing environments $error = 0; - print STDERR ('GetOptions $Revision: 2.6 $ ', + print STDERR ('GetOptions $Revision: 2.6001 $ ', "[GetOpt::Long $Getopt::Long::VERSION] -- ", "called from package \"$pkg\".\n", " (@ARGV)\n", @@ -566,7 +566,7 @@ sub GetOptions { my $opt = shift (@optionlist); # Strip leading prefix so people can specify "--foo=i" if they like. - $opt = $' if $opt =~ /^($genprefix)+/; + $opt = $+ if $opt =~ /^($genprefix)+(.*)/s; if ( $opt eq '<>' ) { if ( (defined $userlinkage) @@ -854,19 +854,19 @@ sub GetOptions { sub find_option { - return 0 unless $opt =~ /^$genprefix/; + return 0 unless $opt =~ /^($genprefix)(.*)/s; - $opt = $'; - my ($starter) = $&; + $opt = $+; + my ($starter) = $1; my $optarg = undef; # value supplied with --opt=value my $rest = undef; # remainder from unbundling # If it is a long option, it may include the value. if (($starter eq "--" || $getopt_compat) - && $opt =~ /^([^=]+)=/ ) { + && $opt =~ /^([^=]+)=(.*)/s ) { $opt = $1; - $optarg = $'; + $optarg = $2; print STDERR ("=> option \"", $opt, "\", optarg = \"$optarg\"\n") if $debug; } @@ -992,7 +992,7 @@ sub find_option { # Get key if this is a "name=value" pair for a hash option. $key = undef; if ($hash && defined $arg) { - ($key, $arg) = ($arg =~ /=/o) ? ($`, $') : ($arg, 1); + ($key, $arg) = ($arg =~ /(.*?)=(.*)/s) ? ($1, $2) : ($arg, 1); } #### Check if the argument is valid for this option #### diff --git a/lib/Pod/Text.pm b/lib/Pod/Text.pm index 9d6636a..2ecaebe 100644 --- a/lib/Pod/Text.pm +++ b/lib/Pod/Text.pm @@ -1,7 +1,5 @@ package Pod::Text; -# Version 1.02 - =head1 NAME Pod::Text - convert POD data to formatted ASCII text @@ -49,6 +47,9 @@ require Exporter; @ISA = Exporter; @EXPORT = qw(pod2text); +use vars qw($VERSION); +$VERSION = "1.0201"; + $termcap=0; #$use_format=1; @@ -116,18 +117,18 @@ POD_DIRECTIVE: while () { next; } - if (/^=for\s+(\S+)\s*/s) { + if (/^=for\s+(\S+)\s*(.*)/s) { if ($1 eq "text") { - print STDOUT $',""; + print STDOUT $2,""; } else { # ignore unknown for } next; } - elsif (/^=begin\s+(\S+)\s*/s) { + elsif (/^=begin\s+(\S+)\s*(.*)/s) { $begun = $1; if ($1 eq "text") { - print STDOUT $'.""; + print STDOUT $2.""; } next; } @@ -409,7 +410,7 @@ sub clear_noremap { defined $HTML_Escapes{$3} ? do { $HTML_Escapes{$3} } : do { - warn "Unknown escape: $& in $_"; + warn "Unknown escape: E<$1> in $_"; "E<$1>"; } } diff --git a/lib/diagnostics.pm b/lib/diagnostics.pm index bbae58e..0aa5b54 100644 --- a/lib/diagnostics.pm +++ b/lib/diagnostics.pm @@ -500,7 +500,7 @@ sub unescape { exists $HTML_Escapes{$1} ? do { $HTML_Escapes{$1} } : do { - warn "Unknown escape: $& in $_"; + warn "Unknown escape: E<$1> in $_"; "E<$1>"; } } diff --git a/os2/OS2/REXX/REXX.pm b/os2/OS2/REXX/REXX.pm index 78e0cf9..114e159 100644 --- a/os2/OS2/REXX/REXX.pm +++ b/os2/OS2/REXX/REXX.pm @@ -107,21 +107,21 @@ sub dropall sub TIESCALAR { my ($obj, $name) = @_; - $name =~ s/^[\w!?]+/\U$&\E/; + $name =~ s/^([\w!?]+)/\U$1\E/; return bless \$name, OS2::REXX::_SCALAR; } sub TIEARRAY { my ($obj, $name) = @_; - $name =~ s/^[\w!?]+/\U$&\E/; + $name =~ s/^([\w!?]+)/\U$1\E/; return bless [$name, 0], OS2::REXX::_ARRAY; } sub TIEHASH { my ($obj, $name) = @_; - $name =~ s/^[\w!?]+/\U$&\E/; + $name =~ s/^([\w!?]+)/\U$1\E/; return bless {Stem => $name}, OS2::REXX::_HASH; }