in reply to Number?
All in all, /\D/ is probably as good as any, but if you're really curious you can benchmark :-)while (<>) { chomp; # All do the same thing print "$_ is a number" unless tr/0-9//c; print "$_ is a number" unless /\D/; print "$_ is a number" if /^\d+$/; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(dchetlin: beware the unicode beast) Re(2): Number?
by dchetlin (Friar) on Oct 25, 2000 at 06:41 UTC | |
by Fastolfe (Vicar) on Oct 25, 2000 at 19:13 UTC | |
by dchetlin (Friar) on Oct 25, 2000 at 19:45 UTC |