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+$/; }
In reply to Re: Number?
by runrig
in thread Number?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |