in reply to So Simple, Yet no tutorial covers it
And it won't work. Now I'm a newbie, ok. So its probably that the regex cant take variables but I'm not sure. All i get when i use this code against a real page that has the same data as the original example and this is the program output:#!/usr/local/bin/perl -w use LWP::Simple; #program starts $totalAdress = "http://www.foobar.com/htmlschuff/data.html"; $content = get($totalAdress) || die "doesn't seem to be a valid adress +: $!"; #Location $start = "<p><b>Location:</b>\n"; $end = "<p>"; if ($content =~ /\b$start\b(.*?)\b$end\b/) { $Location = $1; print $Location; } print "\ndone\n";
Any idea, I'm sure its some newbie mistake but it beats me.$./thecode.pl done $
|
---|
Replies are listed 'Best First'. | |
---|---|
(jeffa) Re: Re: So Simple, Yet no tutorial covers it
by jeffa (Bishop) on Jan 22, 2001 at 07:47 UTC | |
by ichimunki (Priest) on Jan 22, 2001 at 07:50 UTC |