Tim Bowden wrote:
On Tue, 2008-06-24 at 19:37 -0700, John W. Krahn wrote:
Perhaps:
my ( $snippet ) = $string =~ /\w\["([^"]+)",/;
$string =~ /\w\["([^"]+)",/;
my $snippet = $1;
does the trick. I can see If I don't get on top of regex's I'm
seriously restricting the power of perl. Starting to understand them
better now.
You shouldn't do that. If you use the value of a numeric variable
without verifying that the regexp matched successfully then the value in
the numeric variable could be the result of a previous successful match.
John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/