On Thu, 13 Nov 2003 18:15:40 -0500, Nandita Mullapudi wrote:
> I want my script to carry out a loop only if the number stored in
> $diff is positive,
> so i say
> if ($diff =~m/^[-\d+]/) {blah blah}
> but it won't work. why?
That's pretty irrelevant in your case; You're using a cannon to get rid
And the clouds parted, and Jeff 'japhy' Pinyan said...
>
> Well, your regex is matching either a digit, a -, or a + as the first
> character in $diff. If you wanted to match a POSITIVE number, you'd be
> better with /^+?\d/, but WHY are you using a regex for a MATH problem?
>
> if ($diff > 0)
And the clouds parted, and Nandita Mullapudi said...
>
> This has to be really easy- but I cant get it to work:
> I want my script to carry out a loop only if the number stored in
> $diff is positive,
> so i say
> if ($diff =~m/^[-\d+]/) {blah blah}
> but it won't work. why?
> TIA
> -Nandita
Hi N
On Nov 13, Nandita Mullapudi said:
>This has to be really easy- but I cant get it to work:
>I want my script to carry out a loop only if the number stored in
>$diff is positive,
>so i say
>if ($diff =~m/^[-\d+]/) {blah blah}
>but it won't work. why?
Well, your regex is matching either a digit, a
Thanks,
-Nandita
-Original Message-
From: Nandita Mullapudi [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 13, 2003 5:16 PM
To: [EMAIL PROTECTED]
Subject: regexp matching- real simple!
This has to be really easy- but I cant get it to work:
I want my script to carry out a loop only if
On Thu, 2003-11-13 at 18:15, Nandita Mullapudi wrote:
> This has to be really easy- but I cant get it to work:
> I want my script to carry out a loop only if the number stored in
> $diff is positive,
> so i say
> if ($diff =~m/^[-\d+]/) {blah blah}
> but it won't work. why?
> TIA
> -Nandita
Try t
This has to be really easy- but I cant get it to work:
I want my script to carry out a loop only if the number stored in
$diff is positive,
so i say
if ($diff =~m/^[-\d+]/) {blah blah}
but it won't work. why?
TIA
-Nandita
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mai