Repair.pm - repair links in files.
use Repair::Substitutor; use Repair; $linksubs1 = WWW::Link::Repair::Substitutor::gen_substitutor( "http://bounce.com/" , "http://bing.bong/", 0, 0, ); $filehand = WWW::Link::Repair::Substitutor::gen_simple_file_handler ($linksubs); &$filehand("fix-this-file"); use CDB_File::BiIndex; $::index = new CDB_File::BiIndex "page-index-file", "link-index-file"; WWW::Link::Repair::infostructure($index, $filehand, "http://bounce.com/");
This module provides functions that allow the repair of files.
This function recurses through each given directory argument. For each file found it calls the file handler function.
The file handler should be a function which can be called on a filename and will update that file with the new URL.
oldurl is the base URL which should be iterated from. It must exist within the index.
as_directory controlls whether to attempt to replace all links below that link. In this case the index is iterated beyond the first link for all links which begin with the first link.
This function will use a previously build index to update all of the files referenced from that index that need updating.
The index object will be treated as a BiIndex.
The aim of this function is to check whether a given url is full
To install WWW::Link, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::Link
CPAN shell
perl -MCPAN -e shell install WWW::Link
For more information on module installation, please visit the detailed CPAN module installation guide.