sub ProcessFile { my ( $FileName ) = @_; # Open file for reading and writing, slurp entire file into an array. open ( HTML, "+<$FileName" ) or die "Cannot open $FileName for read/write: $!"; my @Line = ; # Seek to the beginning of the file and truncate the file, ready to # write the updated information back in. seek ( HTML, 0, 0 ); truncate ( HTML, 0 ); # Go through the file, deleting zero height and width restriction on IMG # tag, then write corrected line out to the file. my $Count = 0; foreach ( @Line ) { $Count += s/\r//; print HTML $_ or die "Unable to output to $FileName: $!"; } print " $Count"; # Close the file. close ( HTML ); }