In the spirit of showing the code:
#!/usr/bin/perl use strict; use warnings; my $tmp = '<tr bgcolor=#CCFFFF><td><a href="/Tracking/SmcRel30Story">S +mcRel30Story</a></td>r'; use HTML::Parser; my $parser = HTML::Parser->new( start_h => [ \&gethref,"tag,attr" ]); + $parser->parse($tmp); sub gethref { my ( $tag, $attribs) = @_; if ( $tag eq 'a' && exists $attribs->{href} ) { if ( $attribs->{href} =~ /SmcRel30Story/ ) { print $attribs->{href}; } } }
/J\
In reply to Re: How to find the Postion of String
by gellyfish
in thread How to find the Postion of String
by csuresh01
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |