On Tuesday 04 October 2005 09:01, Zielfelder, Robert wrote:
> How can I test the value of a variable to find out if it is an integer
> or a string?
Ultra simple way:
if ($myVar =~ /^\d+$/) {
print "$myVar is a number\n";
} else {
print "$myVar contains things that aren't numbers\n";
}More detail at: perldoc -q "whether a scalar is a number" -- Robin <[EMAIL PROTECTED]> JabberID: <[EMAIL PROTECTED]> Hostes alienigeni me abduxerunt. Qui annus est? PGP Key 0xA99CEB6D = 5957 6D23 8B16 EFAB FEF8 7175 14D3 6485 A99C EB6D
pgp0B3GxxoWoM.pgp
Description: PGP signature
