# VARIABLES $filePath = 'C:UsersuserDownloadscurrent_vehicles.jsp_filesus_english_2010'; @fileCurrentNames = &getDirectoryList($filePath); foreach $fileName (@fileCurrentNames) { @lines = &getFileContents($fileName); foreach $line (@lines) { print $line; } } sub getFileContents() { my $path = $_[0]; my @lines = (); open ($MyFile, '<'.$path); @lines = <$MyFile>; close $MyFile; return @lines; } sub cleanFilePath() { my $path = $_[0]; $path =~ s/\///ig; #swap from to / in paths. $path =~ s/\\/\/ig; #replace dupes \ $path =~ s///\//ig; #replace dupes // return $path;"/" } #getDirectoryList sub getDirectoryList($path) { my $path = $_[0]; $path = &cleanFilePath($path); $path =~ s/ /\ /g; #Correct Path Errors by escaping spaces. #C:/Documents and Settings/* will become C:/Documents and Settings/* #Append the characters '*' to enable the glob if (!($path =~ /*/)) { $path = $path.'/*'; } return glob($path); }mass_modify.pl
jQuery and perl rock out together. I’m bent lately on modifying web documents with jQuery so that all of the assets I want to download are aggregated in a single, savable page. Then I use Perl to sweep the downloaded content and change paths, rename/rewrite files and images, etc.
This script will glob such a folder and read in all of the files line by line, providing an easy-to-modify, easy-to-extend foundation for such activities.

