Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Unexpected parsing

by JadeNB (Chaplain)
on Dec 16, 2009 at 07:23 UTC ( #812985=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my ( $c, $d );
    1 ? $c : $d = 'Hi';
    
  2. or download this
    my ( $c, $d );
    $c = 'Hi';
    
  3. or download this
    my $d;
    1 ? my $c : $d = 'Hi';
    
  4. or download this
    my $d;
    my $c = 'Hi';
    
  5. or download this
    $ perl -MO=Deparse -e 'my $c; 1 ? $c : my $d; $d'
    my $c;
    $c;
    $d;
    -e syntax OK
    
  6. or download this
    $ perl -e '1 ? my $c : my $d'
    Invalid separator character '$' in attribute list at -e line 1, near "
    +$c : my "
    Execution of -e aborted due to compilation errors.
    
  7. or download this
    our $d = 'Out';
    {
    ...
        $d = 'In';
    }
    say $d;
    
  8. or download this
    our $d = 'Out';
    {
    ...
        $d = 'In';
    }
    say $d;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://812985]
Approved by moritz
Front-paged by planetscape
help
Chatterbox?
and the web crawler heard nothing...

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





    Results (111 votes). Check out past polls.

    Notices?