in reply to reading files

Beginner?! Welcome!

Here are some tips to read files:

open (FILEHANDLE,"file.txt") ; @data = <FILEHANDLE> ; close (FILEHANDLE) ; chomp(@data); ## this will cut off the \n or \r ## in the end of each line.
This will read all the file too, but is a better way for big files:
open (FILEHANDLE,"file.txt") ; my $data ; 1 while( read(FILEHANDLE, $data , 1024*8 , length($data) ) ) ; close (FILEHANDLE) ;

This will read line by line:

open (FILEHANDLE,"file.txt") ; while ($line = <FILEHANDLE>) { ... } close (FILEHANDLE) ;

If you are trying to open binary files, use binmode() after open:

open (FILEHANDLE,"file.txt") ; binmode(FILEHANDLE) ;

In your code you tell that don't want to do $line = $line . $_ ;
This is not a good thing, because you rewrite all the variable for each loop, and is more slow. Do that:

$line .= $_
You will find the same thing for:
$var += 10 ; # $var = $var + 10 ; $var -= 10 ; # $var = $var - 10 ; $var *= 10 ; # $var = $var * 10 ; $var /= 10 ; # $var = $var / 10 ;
See the site http://www.perldoc.com for more!

Graciliano M. P.
"The creativity is the expression of the liberty".