The select Function : select « File « Perl






The select Function

    

#! /usr/bin/perl
open (FILEOUT,">newfile")  || die "Can't open newfile: $!\n";
select(FILEOUT);      
open (DB, "<datebook") || die "Can't open datebook: $!\n";
while(<DB>) {
   print ;            
}
select(STDOUT);       
print "Good-bye.\n";  

   
    
    
    
  








Related examples in the same category

1.Redirects standard input and output and turns off buffering.
2.Selecting A Log File