in reply to Re: comparing array elements
in thread comparing array elements

I keep wanting to think of "running" as "1" and "not running" as "0"; Which is causing me to have trouble with sub is_running, which, if I read it correctly, returns "0" if running. Whereas sub init sets an initial widget state of "0" and sub set_running sets them to "1"; However sub replace sets "out" to "0" ("out" to me indicating "out of the pool" i.e. running) and "in" (as in, back in the garage so to speak, or not running anymore) to "0";

So if is_running returns "0" if foo is running, I would do something like:

if (is_running('foo')){ # because "1" means "no" set_running('foo'); }
which seems so unnatural that I'm sure I must be missing the point somewhere.

Replies are listed 'Best First'.
Re^3: comparing array elements
by jdporter (Paladin) on Mar 30, 2007 at 19:50 UTC

    No, that was a coding error on my part. I copied the line from the sub above, and forgot to delete the  =0 part. Sorry; my bad. (Fixed now.)

      Cool, so I'm not losing my mind!

      and since I actually got --'d for that, I guess I should ask: was there something about my question or how I asked it that was inappropriate or that was not in keeping with the spirit of PM? I certainly don't wish to offend anyone; my impression is that asking questions is OK. There are entire sections of the site devoted to it...

      Any guidance would be appreciated. It also might help curb whatever tendencies of mine are being frowned upon, thus minimizing the offensive behavior in the future.