On 2/8/06, Mike Blezien <[EMAIL PROTECTED]> wrote:
> I'm trying to extract an image name from the follow html tag
> i tried:
> $imageURL =~ !<IMG SRC="picserve.cgi?picserve=/(.*)" BORDER=0>!;
> $pic = $1;
>
> but that produces errors. what I'm doing wrong here ??
Your small error is forgetting that the question mark is a
metacharacter. See the perlre documentation.
Your medium error is misusing the syntax of the m// pattern match
operator. See perlop.
Your large error is trying to use a regular expression to manipulate
HTML. Use a robust module from CPAN.
http://search.cpan.org/
You could get away with a pattern instead of a module if you have a
very simple case. But using a module means a simpler pattern, and less
chance of something going wrong as a result.
Hope this helps!
--Tom Phoenix
Stonehenge Perl Training
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>