in reply to split question
split may not be so hot for this, especially behind an =~ operator... .
I'd suggest using a regex for this, something similar to :
I'd suggest using a regex for this, something similar to :
my $inLine= "RPC, rpc #001b, (1987)"; $inLine=~/\((\d+)\)/; print $1
or, if you really wanna use split,
my $inLine= "RPC, rpc #001b, (1987)"; ($itm, $date)= split /[()]/, $inLine; print $date;
but I'd shy away from that, personally.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: split question (boo)
by chiller (Scribe) on Sep 08, 2001 at 03:44 UTC |
In Section
Seekers of Perl Wisdom