On Jun 25, 11:20 am, [EMAIL PROTECTED] (Tim Bowden) wrote: > Hi, > > I'm trying to isolate text in a string. My string is typically of the > form: > sometext["moretext", > > I would like to isolate moretext. > > I tried: > #!/usr/bin/perl -w > my $string = 'sometext["moretext",'; > print $string; > my $snippet; > ($snippet, $snippet) = split(/$string/,\[,2); > print "$snippet\n"; >
Did you mean: ------------------------------------------ use warnings; $string = 'sometext["moretext",'; my ($discard, $keep) = split /\[/, $string; print $keep, "\n"; ------------------------------------------ Cheers, Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/