#!/usr/bin/perl 
#w3.11.pl read in from a file and write out to a file, using command line
#arguments for file names.  The reserved argument variable @ARGV


open (FH, "$ARGV[0]");
while (<FH>){
   @lines = (@lines, $_);
} 
close (FH);


if ($ARGV[1] eq ""){
   print @lines;}
else {

open(OUT, ">>$ARGV[1]");
   foreach (@lines){
      $x++;
      print(OUT "line $x: $_") ;
   }
   close (OUT);

}					# End else

__END__

