in reply to matching digits and characters
Wow! That's the first triple negative I've seen in the wild in a long time:)
You code reads:
Print "non-digits found" if $str doesn't match things that are not non-digits!
Try: print '"non digits found" if $str contains non-digits. (It's easier for a human being to read:)
print 'non digits found' if $str =~ /\D/;
Note: Using /g in the scalar context of an if statement is probably superfluous.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: matching digits and characters (scalar //g)
by tye (Sage) on Aug 22, 2003 at 16:46 UTC | |
by BrowserUk (Patriarch) on Aug 22, 2003 at 16:59 UTC |