Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Unexpected parsing

by BrowserUk (Pope)
on Dec 16, 2009 at 07:35 UTC ( #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
Node Status?
node history
Node Type: note [id://812986]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2021-05-11 13:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (116 votes). Check out past polls.

    Notices?