develooper Front page | perl.perl5.porters | Postings from February 2013

Re: Salvaging lexical $_ from deprecation

Thread Previous | Thread Next
From:
Tom Christiansen
Date:
February 20, 2013 00:35
Subject:
Re: Salvaging lexical $_ from deprecation
Message ID:
14161.1361320489@chthon
Rafael Garcia-Suarez <rgs@consttype.org> wrote
   on Tue, 19 Feb 2013 22:53:41 +0100: 

> I stand corrected. (Pretty sure the internals don't do a full
> localisation though :)

If this is wrong, I would be pleased to be corrected.

    =head2 Regular Expression Special Variables

    The following special variables related to pattern matching are visible
    throughout the dynamic scope in which the pattern match occurred.  In other
    words, they behave as though they were declared with C<local>, so you
    needn’t declare them that way yourself.  See Chapter 5, Pattern Matching.

      $I<digits>

      $& ($MATCH)
      $' ($POSTMATCH)
      $` ($PREMATCH)

      ${^MATCH}
      ${^POSTMATCH}
      ${^PREMATCH}

      $+ ($LAST_PAREN_MATCH)
      %+ (%LAST_PAREN_MATCH)
      @+ (@LAST_MATCH_END)

      @-
      %-

      $^R ($LAST_REGEXP_CODE_RESULT)
      $^N ($LAST_SUBMATCH_RESULT)

--tom

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About