J
Janek Schleicher
ARAVIND wrote at Sat, 05 Jul 2003 04:11:57 -0700:
I doubt it. I get
$splitval[0] eq "ARAVIND 2" and
$splitval[1] eq " BANGALORE"
Well you could do instead a
split /\s*\d+\s*/, $temp;
# or
split /[\s\d]+/, $temp;
But you also could solve it with a regexp:
my @splitval = $temp =~ /(\w+)/g;
Greetings,
Janek
say i have a variable
$temp = "ARAVIND 25 BANGALORE";
I want just ARAVIND and BANGALORE
if i do
@splitval = split /\d /,$temp;
then i get
$splitval[0] = 'ARAVIND 25';
$splitval[1] = 'BANGALORE';
I doubt it. I get
$splitval[0] eq "ARAVIND 2" and
$splitval[1] eq " BANGALORE"
i can further split it from $splitval[0] and get only ARAVIND.
but how to make it one shot....spliting.
Well you could do instead a
split /\s*\d+\s*/, $temp;
# or
split /[\s\d]+/, $temp;
But you also could solve it with a regexp:
my @splitval = $temp =~ /(\w+)/g;
Greetings,
Janek