# Opening a file for append: open(F, ">>logfile"); print F "Writing to the logfile\n"; # Writing to a pipe -- this will sort input2 and put the result in output2 open(F2, "|sort > output2"); open(IN, "input2"); print F2 (); # Reading from a pipe -- this will sort input3 and put the result in output3 open(F3, "sort input3|"); open(OUT, ">output3"); print OUT (); # This sorts input4 numerically and puts the output into output4 open(F4, "input4"); open(OUT4, ">output4"); print OUT4 sort { $a <=> $b } ;