TIP: Click on subject to list as thread! ANSI
echo: perl
to: David Drummond
from: tony summerfelt
date: 2004-09-15 10:42:12
subject: Question

# On Wed, Sep 15/04 at 09:39 PM, David Drummond wrote to PERL experts:

 DD> Can anyone suggest a simple one line that determines if a variable
 DD> contains alpha/numeric data, or a straight numeric value?

$scalar="123test"

$scalar !~ /\D/ ? print "scalar only digits" : print "string
has other chars"


.t

... telnet://ventedspleen.dyndns.org
--- GoldED/spleen 3.0.1+
* Origin: ventedspleen.dyndns.org (1:249/100)
SEEN-BY: 633/267 270
@PATH: 249/100 261/38 123/500 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.