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

Re^3: elsif statement not being evaluated

by afoken (Abbot)
on Nov 18, 2012 at 08:35 UTC ( #1004386=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    if ($answer=42) { # $answer is now always 42
        ...
    ...
        ...
    }
    
  2. or download this
    use Readonly;
    Readonly my $fortytwo => 42; # note: =>, not =
    ...
    if ($fortytwo=$answer) { # "Modification of a read-only value attempte
    +d"
        ...
    }
    
  3. or download this
    use constant FORTYTWO => 42; # note: =>, not =
    
    ...
    if (FORTYTWO=$answer) { # "Can't modify constant item in scalar assign
    +ment"
        ...
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1004386]
help
Chatterbox?
marto waves

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (9)
As of 2017-11-21 14:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (302 votes). Check out past polls.

    Notices?