# File: fileWrite.pl # Title: Writes in a file # Author: Mihaela Malita # >perl fileWrite.pl # Writes in a file: testout.txt # Input a string? Mary # Look in the file: testout.txt you'll see Mary $filename = "testout.txt"; print "Writes in a file: $filename"; print "\nInput a string? "; $r = ; # chop($R); # if you take this out it will jump to next line open(OUT,">$filename"); print OUT $r; print OUT $r; # write one after the other if you put chop($R) close OUT; print "\nLook in the file: $filename, you'll see $R"; exit;