<p>Is there a simple way in Perl that will allow me to determine if a given variable is numeric?  Something along the lines of:</p>

<pre><code>if (is_number($x))
{ ... }
</code></pre>

<p>would be ideal.  A technique that won't throw warnings when the <code>-w</code> switch is being used is certainly preferred.</p>

Not perfect, but you can use a regex:
```
```
sub isnumber 
{
    shift =~ /^-?\d+\.?\d*$/;
}
```
```