Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: elsif statement not being evaluated

by Anonymous Monk
on Nov 18, 2012 at 06:22 UTC ( #1004378=note: print w/ replies, xml ) Need Help??


in reply to elsif statement not being evaluated

This is a frequent pitfall

my $one = 1; print "one $one\n"; if ( $one = 2){ print "one $one\n"; $one = 22; } else { $one = 3; } print "one $one\n"; __END__ one 1 one 2 one 22

Common Perl Pitfalls / perltrap

Tutorials: Basic debugging checklist , brian's Guide to Solving Any Perl Problem

perlintro, http://learn.perl.org/books/beginning-perl/, http://perl-tutorial.org/, Tutorials: Basic debugging checklist , brian's Guide to Solving Any Perl Problem, Modern Perl book, a loose description of how experienced and effective Perl 5 programmers work....You can learn this too.

The Perl Monks Guide to the Monastery


Comment on Re: elsif statement not being evaluated
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2015-07-31 00:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (274 votes), past polls