Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1004378]
help
Chatterbox?
[M4ver1k]: I feel like being able to toggle a running script on the fly by updating variables from a config file using Config::Simple. But in the while loop, it seems like it doesn't update the variable after the first past. Is this generally just a bad idea?
[M4ver1k]: pass*

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













    Results (283 votes). Check out past polls.

    Notices?