coder57 has asked for the wisdom of the Perl Monks concerning the following question:
#! perl\bin\perl use strict; use warnings; use WWW::Mechanize; my $mech = WWW::Mechanize->new(); open(FILE, "< file1.html") || print "Unable to open the file file1 \n" +; while (<FILE>) { if($_ =~ /on\.fe/) { my $url = $_; print $mech->uri."\n"; $mech->get($_); $mech->content(); if($mech->content()=~ /www\.arax/) { my $url2 = $mech->content() =~ /www\.arax/; print $mech->uri."\n"; s/$url/$url2/; print; } } } close(FILE);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Substituting for each regular exp in a local file
by jettero (Monsignor) on Dec 23, 2006 at 15:42 UTC | |
by coder57 (Novice) on Dec 23, 2006 at 18:51 UTC | |
by coder57 (Novice) on Dec 24, 2006 at 18:30 UTC |