TIP: Click on subject to list as thread! ANSI
echo: perl
to: tony summerfelt
from: David Drummond
date: 2004-09-16 16:05:20
subject: Question

G'day tony

15 Sep 04 10:42, tony summerfelt wrote to David Drummond:

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

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

 ts> $scalar="123test"

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

Thanks - simple when one knows how :-)

Regards,
David

--- Msged/LNX TE 06 (pre)
* Origin: Here. (3:640/305)
SEEN-BY: 633/267 270
@PATH: 640/305 954 774/605 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™.