Hi folks,

I've done some googling but haven't found anything that (a) does what i want 
or (b) I understand.

I've got the following code repeated thoughout a program I'm writing. I'm 
using www::Mechanize but because of extensive javascript usage on the web 
site I'm accessing I'm having to do a lot of manual HTML parsing.

The code is:

foreach (split(/\n/,$html)) {
  if (/HREF="(.*)".*SomeDisplayText/) {
  $URL=$1;
  last;
}

Is there a way I can change this to a sub and pass the HTML string and the 
regex as arguments?

Thanks
-- 
Gary Stainburn
I.T. Manager
Ringways Garages
http://www.ringways.co.uk 

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to