develooper Front page | perl.perl5.porters | Postings from January 2011

RE: Using smart matching to find whether an array contains a string

Thread Previous | Thread Next
From:
vadim.konovalov
Date:
January 27, 2011 01:57
Subject:
RE: Using smart matching to find whether an array contains a string
Message ID:
35BF8D9716175C43BB9D67CA60CC345E2756C162@FRMRSSXCHMBSC2.dc-m.alcatel-lucent.com
> >And it can even be more subtle:
> >
> >    $ perl -E '$a = $b = "abc100"; 0 + $b; say $a; say $b;
> >                             $a ++; $b ++; say $a; say $b'
> 
> That is a nasty one.  Surely the expression 0 + $b should not 
> mutate the value
> of $b.  I'm surprised this is not considered a bug?

Have you read 

  perldoc Scalar::Util

dualvar section?

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