Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Why Perl gets confused here?

by NetWallah (Canon)
on Oct 26, 2017 at 05:57 UTC ( [id://1202053]=note: print w/replies, xml ) Need Help??


in reply to Why Perl gets confused here?

You have som extra parens.
Here is how the code is being interpreted:
substr(substr($p, 0, 1) = '123', 0, 1) = 'x'; substr((substr($q, 0, 1)) = '123', 0, 1) = 'x';
B::Deparse is your friend.

                All power corrupts, but we need electricity.

Replies are listed 'Best First'.
Re^2: Why Perl gets confused here?
by Anonymous Monk on Oct 26, 2017 at 20:54 UTC
    i dont think extra parens kill lvalues
    $ perl -le 'sub x:lvalue{$a} x="y";print$a' y $ perl -le 'sub x:lvalue{$a} (x)="y";print$a' y
      $ perl -le'sub x:lvalue{$a} print scalar( x="y" );' y $ perl -le'sub x:lvalue{$a} print scalar( (x)="y" );' 1

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1202053]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-04-24 02:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found