Re: A Problem With GD
- From: Abigail <abigail@xxxxxxxxxx>
- Date: 11 Mar 2006 21:20:50 GMT
Abigail (abigail@xxxxxxxxxx) wrote on MMMMDLXXV September MCMXCIII in
<URL:news:slrne163ac.p75.abigail@xxxxxxxxxxxxxxxxxxxx>:
:) Mark Manning (markem@xxxxxxxxxxx) wrote on MMMMDLXXV September MCMXCIII
:) in <URL:news:1215ur1bndeb911@xxxxxxxxxxxxxxxxxx>:
:) <> Glenn Jackman wrote:
:) <> > At 2006-03-08 04:48AM, Dave Weaver <zen13097@xxxxxxxxx> wrote:
:) <> >
:) <> > However,
:) <> > $i = -1
:) <> > while (++$i < 10) {...
:) <> > does.
:) <> >
:) <>
:) <> What is your favorite method for implementing a toggle switch? Mine is:
:) <>
:) <> $var = ($var + 1) % 2;
:)
:)
:) If I'm going to use the switch in boolean context only:
:)
:) $var = !$var;
:)
:) else:
:)
:) $var = 1 - $var;
:)
:) or:
:)
:) ($var += 1) %= 2;
$var = [1, 0] -> [$var];
Abigail
--
$_ = "\x3C\x3C\x45\x4F\x54"; s/<<EOT/<<EOT/e; print;
Just another Perl Hacker
EOT
.
- Follow-Ups:
- Re: A Problem With GD
- From: Mark Manning
- Re: A Problem With GD
- From: robic0
- Re: A Problem With GD
- References:
- Re: A Problem With GD
- From: Mark Manning
- Re: A Problem With GD
- From: A. Sinan Unur
- Re: A Problem With GD
- From: Mark Manning
- Re: A Problem With GD
- From: Dave Weaver
- Re: A Problem With GD
- From: Glenn Jackman
- Re: A Problem With GD
- From: Mark Manning
- Re: A Problem With GD
- From: Abigail
- Re: A Problem With GD
- Prev by Date: Re: Turning a list of scalars into an array?
- Next by Date: Re: Turning a list of scalars into an array?
- Previous by thread: Re: A Problem With GD
- Next by thread: Re: A Problem With GD
- Index(es):
Relevant Pages
|