Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Unexpected parsing

by BrowserUk (Patriarch)
on Dec 16, 2009 at 07:35 UTC ( [id://812986]=note: print w/replies, xml ) Need Help??


in reply to Unexpected parsing

This is fine:

c:\test>perl -MO=Deparse -e "my $c; 1 ? $c : my( $d ); $d" my $c; $c; $d; -e syntax OK

In your version, it's trying to parse an attribute--like $c :shared


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^2: Unexpected parsing
by JadeNB (Chaplain) on Dec 16, 2009 at 08:06 UTC
    In your version, it's trying to parse an attribute--like $c :shared
    I figured out from the error message what was happening with the parsing, but couldn't tell what was different about the 2 cases involving my $c that made them parse differently. I have updated my post with a guess (that it's the whitespace-plus-alphanumeric after the colon), but I'm not sure whether this is the desired behaviour or a bug (or my guess is wrong!).

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-04-16 22:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found