If it is at the start of the variable, then
if ( $a =~ /^(\d+)/ ) {
$numeric = $1;
}else {
# no starting digits, what do you want to do?
}
Wags ;)
-----Original Message-----
From: Hubert Ian M. Tabug [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 06, 2001 21:48
To: Perl
Subject: Line Parsing/Splitting
Hello,
Given that $a = `1234 abcde abdcd acbd`;
Would anyone know of of a way for me to just "extract" the numerical
portion of the string. The numerical part is not fixed in length it could be
composed4, 3, 2 or 1 digit I was thinking that the string could be treated as an array
of characters and that I could just parse the string by
accessing its index, say $a[0]?? Your assistance would be greatly appreciate.
Hubert
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]