Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Variable Declaration

by Roy Johnson (Monsignor)
on Aug 31, 2007 at 15:09 UTC ( [id://636350]=note: print w/replies, xml ) Need Help??


in reply to Variable Declaration

$var1 is defined in the scope of the if-blocks. It is not available outside them. Your example here is probably better written as
my $var2 = (cond 1) ? 'a' : 'y';
Downvotes without explanation continue to be the scourge of Perlmonks.

Caution: Contents may have been coded under pressure.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (1)
As of 2024-04-25 04:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found