[Israel.pm] cutting characters from a string

Gabor Szabo gabor at perl.org.il
Fri Jan 9 15:56:37 PST 2004

On Fri, 9 Jan 2004, Lena Farid wrote:

> Hi ppl,
> I need to cut certain characters from a string .
> +'events/news.htm"><img   this is my string and i want to only have
> events/news.htm without the rest
> i'm using ~ y/[+\"\'<>*]//d to remove the characters specified within
> the [ ] but is there a way to tell perl to cut everything before and
> after events/news.htm? becasue the alphabetical characters after the
> part I need aren't always the same
> Any tips?

I am not sure I understand what you are trying to do so let me
just shout in the default answer.
By some magic it might fit your question :-)

Don't parse HTML manually! Use HTML::Parse.
Also look at html2text on http://search.cpan.org/
or some similar thing. Maybe you need that.


More information about the Perl mailing list