sulfericacid has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use CGI qw(:all); use Fcntl qw(:flock); use HTTP::Request; print header; open(F, "pageinfo.htm"); while(<F>) { print "$_"; } if(!param) { exit; } $fristring = param('urlinfo'); use LWP::UserAgent; $ua = new LWP::UserAgent; $ua->agent("Mozilla/5.0"); $ua->timeout('30'); $req = new HTTP::Request GET => $fristring; $req->header('Accept' => 'text/html'); $result = $ua->request($req); $_ = $result->content; $looper = 0; while($looper < 5000) { s/</</; $looper++; } @lines = split /\n/, $_; print "<textarea>"; foreach $line (@lines) { if($line =~ /test/) { $1 =~ s/<p>//gi; print $1; } if($line =~ /meta/) { print "$line" }; } # print $_; print "<\/textarea>";
Escaped html in first 'graph - dvergin 2003-03-03
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: =~ and substitutions
by chromatic (Archbishop) on Mar 03, 2003 at 20:24 UTC | |
|
Re: =~ and substitutions
by dws (Chancellor) on Mar 03, 2003 at 20:20 UTC | |
|
Re: =~ and substitutions
by tall_man (Parson) on Mar 03, 2003 at 19:57 UTC | |
by sulfericacid (Deacon) on Mar 03, 2003 at 20:02 UTC | |
by tall_man (Parson) on Mar 03, 2003 at 20:26 UTC | |
|
Re: =~ and substitutions
by jobber (Sexton) on Mar 03, 2003 at 20:21 UTC | |
by chromatic (Archbishop) on Mar 03, 2003 at 20:28 UTC |