# No.42 Perl Sample (code key - 77) # Learning Perl: output to an external file (外部のファイルに出力する) # Tomonori Nagano # Last Update: January 18, 2008 # # This file is encoded in Unicode (UTF-8). If you see gibberish characters, # please re-encode the file in utf-8. # print "Type the output file name: " ; # ask for the output filename $outfile = ; # chomp ($outfile) ; # get rid of the end-of-line symbol open(OUTFILE,">$outfile") or die "cannot open $outfile:$!\n" ; # open outfile print OUTFILE "printing to outfile\n" ; # printout to OUTFILE close (OUTFILE) ; # close OUTFILE