turbolofi has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w # Get urls from result page use warnings; use strict; use LWP::Simple; my ($html, $url); my $count = 0; $html = get("http://localhost:8080/html.htm") or die "Couldn't fetch p +age."; while($html) # <- Problematic part.. { $html =~ m{<(a class=\"smallV110\" href=\"/)(.*?)\">} || die "couldn't + match"; #match regexp and capture backreference to $2, or die with e +rror $url = $2; print "$url\n"; $count++; print "$count\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Ending a loop of content of LWP's get-function
by ikegami (Patriarch) on Mar 27, 2009 at 17:02 UTC | |
by turbolofi (Acolyte) on Mar 27, 2009 at 17:32 UTC | |
by ikegami (Patriarch) on Mar 27, 2009 at 17:45 UTC | |
|
Re: Ending a loop of content of LWP's get-function
by zentara (Cardinal) on Mar 27, 2009 at 17:32 UTC | |
|
Re: Ending a loop of content of LWP's get-function
by toolic (Bishop) on Mar 27, 2009 at 17:09 UTC | |
|
Re: Ending a loop of content of LWP's get-function
by turbolofi (Acolyte) on Mar 27, 2009 at 18:07 UTC |