Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Now here is how I did it but want to know if I could do the same with all my relative links on this one webpage. I assume I need some reg expressions that is more complicated than what I have done?relative link before my script: directory/file.doc after script: http://www.mysite.com/directory/file.doc
my $db = 'webpage'l'; open(DATA, "$db") or die "File does not open: $!"; my @data = (<DATA>); close (DATA); open(DATA, ">$db") or die "File not open: $!"; foreach my $line (@data) { $line =~ s?<A HREF="directory/file.doc">?<A HREF="http://www.mysite. +com/directory/file.doc">?g; print DATA $line; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Changing from relative to absolute path
by davorg (Chancellor) on Sep 05, 2002 at 12:33 UTC | |
|
Re: Changing from relative to absolute path
by Nemp (Pilgrim) on Sep 05, 2002 at 12:37 UTC | |
by davorg (Chancellor) on Sep 05, 2002 at 12:52 UTC | |
by Nemp (Pilgrim) on Sep 05, 2002 at 13:06 UTC | |
by Abigail-II (Bishop) on Sep 05, 2002 at 13:33 UTC | |
by davorg (Chancellor) on Sep 05, 2002 at 13:13 UTC | |
by Nemp (Pilgrim) on Sep 05, 2002 at 13:16 UTC | |
by Anonymous Monk on Sep 05, 2002 at 13:20 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |