From: Gurusamy Sarathy Date: Mon, 1 May 2000 08:39:18 +0000 (+0000) Subject: introduce @LAST_MATCH_START and @LAST_MATCH_END, English aliases X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fe3079813a2f08204ed96a614faf9e57693108d1;p=p5sagit%2Fp5-mst-13.2.git introduce @LAST_MATCH_START and @LAST_MATCH_END, English aliases for @- and @+ (from Johan Vromans) p4raw-id: //depot/perl@6030 --- diff --git a/lib/English.pm b/lib/English.pm index f6e3ec0..f38c313 100644 --- a/lib/English.pm +++ b/lib/English.pm @@ -98,6 +98,8 @@ sub import { *OSNAME *LAST_REGEXP_CODE_RESULT *EXCEPTIONS_BEING_CAUGHT + @LAST_MATCH_START + @LAST_MATCH_END ); # The ground of all being. @ARG is deprecated (5.005 makes @_ lexical) @@ -110,6 +112,8 @@ sub import { *PREMATCH = *` ; *POSTMATCH = *' ; *LAST_PAREN_MATCH = *+ ; + *LAST_MATCH_START = *-{ARRAY} ; + *LAST_MATCH_END = *+{ARRAY} ; # Input. diff --git a/pod/perlvar.pod b/pod/perlvar.pod index 4ad8d12..15308e4 100644 --- a/pod/perlvar.pod +++ b/pod/perlvar.pod @@ -174,6 +174,8 @@ example: (Mnemonic: be positive and forward looking.) This variable is read-only and dynamically scoped to the current BLOCK. +=item @LAST_MATCH_END + =item @+ This array holds the offsets of the ends of the last successful @@ -412,6 +414,8 @@ channel. Used with formats. (Mnemonic: lines_on_page - lines_printed.) +=item @LAST_MATCH_START + =item @- $-[0] is the offset of the start of the last successful match.