Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: comarison synthax question

by Fletch (Bishop)
on Apr 11, 2007 at 20:42 UTC ( [id://609473]=note: print w/replies, xml ) Need Help??


in reply to comarison synthax question

You're getting closer with the second, but && is the boolean AND operator (& is the bitwise AND; see perlop for more details).

And using grep might be a bit more idiomatic, especially since the numbered variable names is a common red flag that you should really be using an array instead.

my @statuses = _frobulate_status_processes( ); my $running_frobulators = grep { m/\A Running \z/xi } @statuses; if( @statuses == $running_frobulators ) { print "All processes frobulating\n"; } else { print "Only $running_frobulators of ", scalar @statuses, " running\n +"; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2024-04-19 09:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found