Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: order of operations with conditionals at the end

by Khen1950fx (Canon)
on Mar 26, 2012 at 21:49 UTC ( [id://961764]=note: print w/replies, xml ) Need Help??


in reply to order of operations with conditionals at the end

There are a couple of problems that I see. First, unless not is the same as if. Second, you have an undefined subroutine in isBad.
#!/usr/bin/perl -l use strictures 1; no strict 'refs'; use Devel::SimpleTrace; print my $message = 'Congrats' if defined ${'result'}; my @badVals; foreach my $val (my(@vals)) { push @badVals, $val && next if isBad($val); print "$val is a good val"; } sub isBad {...}

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2024-04-19 06:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found