develooper Front page | perl.perl5.porters | Postings from October 2014

Re: [perl #122947] [EXPERIMENT] Lvalue references

Thread Previous | Thread Next
From:
Paul "LeoNerd" Evans
Date:
October 14, 2014 14:43
Subject:
Re: [perl #122947] [EXPERIMENT] Lvalue references
Message ID:
20141014154340.19c1d339@shy.leonerd.org.uk
On Tue, 14 Oct 2014 08:47:15 -0400
Ricardo Signes <perl.p5p@rjbs.manxome.org> wrote:

> Also, we have LVALUE refs.  Is this feature actually
> related to that?

The things we have that are called LVALUE are the lvalues returned by
the substr() function so that mutations of it can affect the original:

  my $str = "Hello world";
  substr( $str, 0, 5 ) = "Goodbye";   <== assignment to an LVALUE

-- 
Paul "LeoNerd" Evans

leonerd@leonerd.org.uk
http://www.leonerd.org.uk/  |  https://metacpan.org/author/PEVANS

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