On Fri, 2006-09-06 at 06:10 -0700, Randal L. Schwartz wrote:
> >>>>> ""John" == "John W Krahn" <[EMAIL PROTECTED]> writes:
> 
> "John> Wouldn't
> 
> "John>          $variable = !!$variable;
> 
> "John> work just as well?
> 
> No.  There's no promise that the output of ! is "0" and "1".  In fact,
> it's "" and "1".  And that's exactly what I was trying to avoid.

How about?

  $variable = 1 - !$variable;


-- 
__END__

Just my 0.00000002 million dollars worth,
   --- Shawn

"For the things we have to learn before we can do them, we learn by doing them."
  Aristotle

* Perl tutorials at http://perlmonks.org/?node=Tutorials
* A searchable perldoc is at http://perldoc.perl.org/



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to