The Basics

Input:
open( FH, "<filename");
open( FH, "input-pipe-command");
open( FH, "ls -1 *.fio");
read with $line = <FH>;
Output:
open( FH, ">filename"); new file
open( FH, ">>filename"); append
open( FH, "| output-pipe-command");
write with print FH "whatever\n";
Close:
close( FH);

Example:

open( FH, ">fh.output"); 
print FH "there is no comma between 'FH' and this string \n"; 
close( FH); 

open( FH, "<fh.output"); 
while( my $line = <FH>) {
    chomp $line;        # remove the trailing <new-line> 
    print ": $line \n"; 
}
close( FH);