[JaxPM] && usage?

Bill Jones sneex at mac.com
Sat Jan 5 15:33:44 CST 2002


On the jacksonville-pm-list; Jax.PM'er Bill Jones <sneex at mac.com> wrote -

RFC:

I am wondering about using the short-circuit && operator to execute 
multiple commands should some condition exist.  I ask the list 
their respective opinion(s) about anything good, bad, or ugly 
about &&.  Thx :)

An example snippet (not -w or strict safe, hell it likely doesn't 
work) -

while (defined($_ = <DATA>)) {
         ++$process && chomp;
         s{\/\*.*} {};  # No C/CSS-like comments...
         s{^\s+}   {};  # No leading whitespace...
         s{\s+$}   {};  # No trailing whitespace...
         ++$empty && next unless length;

         $curline = $_;
         &sx_css_not_handled($curline) && next if ($curline =~ /#/);

         &sx_do_head() && next unless $headdone;
}


:)
???/Sx ?


Jax.PM Moderator's Note:
This message was posted to the Jacksonville Perl Monger's Group listserv.
The group manager can be reached at -- owner-jacksonville-pm-list at pm.org
to whom send all praises, complaints, or comments...




More information about the Jacksonville-pm mailing list