[JaxPM] counting a string

Bill Jones bill at fccj.org
Fri Feb 25 19:12:58 CST 2000


On the jacksonville-pm-list; Jax.PM'er Bill Jones <bill at fccj.org> wrote -


> From: Nate <nate at netimages.com>
> Date: Fri, 25 Feb 2000 13:02:15 -0800 (PST)
> To: Bill Jones <bill at fccj.org>
> Cc: Jax Perl Mongers <jacksonville-pm-list at happyfunball.pm.org>
> Subject: Re: [JaxPM] counting a string
> 
> I knew that < and > are for numbers, but Larry and Randal make a big deal
> in all the docs about how perl will treat a string like a number if you
> use it as a number.
> 
> I guess I read it wrong.


No, I spoke it wrong.  Use <, >, et al for numbers and use EQ, et al for
strings.  Sometimes the perl system will auto-convert, but only if the
string truly is a number.  For example:

Strings (not NUMBERS!)
______________________

"Alpha 12345 Beta"

Strings that act like NUMBERS!
______________________________

"12345 Alpha Beta"  (but is this behavior what you want or expect?)

True number conversions:
________________________

"0"
"1"

and the like.  Did I explain good?   -Sneex-  :]
____________________________________________________________________
Bill Jones * Systems Programmer * http://www.fccj.org/cgi/mail?sneex

                                   ('>   Running -
                                   //\   Perl, Apache, MySQL, PHP3,
                                   v_/_  Ultra 10, LinuxPPC, BeOS...


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