zodiac has asked for the wisdom of the Perl Monks concerning the following question:
sub blahify(\$$) { my $bla = ${shift()}; my $url = shift; my @x = (); my $host = $url; my $there = $url; $host =~ s%(http://[^/]*?/).*%$1%i; $there=~ s%(http://[^/]*?/.*/).*%$1%i; while($bla =~ m%(href="[^"]*")%ig) { my $boo = $1; next if $boo=~ m%href="http://%i; if( $boo =~ m%href="(/.*?)"%i) { push @x, $1; next; } printf STDERR "bad href: $boo\n"; } foreach (@x) { print "killing $_\n"; $bla =~ s/$_/$host$_/i; } my $foo = $x[0]; print "ALERT\n"if($bla=~/$foo/); return $bla; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: adding hostnames to absolute links
by chromatic (Archbishop) on Oct 21, 2000 at 00:27 UTC | |
|
Re: adding hostnames to absolute links
by merlyn (Sage) on Oct 21, 2000 at 02:17 UTC | |
|
Re: adding hostnames to absolute links
by Fastolfe (Vicar) on Oct 24, 2000 at 19:00 UTC |