# No.45 Perl Sample (code key - 52) # Learning Perl: reading files from a command line (コマンドラインからファイル名を読み込む) # 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. # if ($#ARGV != 1) { # if the number of arguments is not 2 # show an error with the usage guideline die "usage: perl fileIO.pl firstFile.txt secondFile.txt\n" ; } $firstFile = $ARGV[0] ; # read the path to the first file $secondFile = $ARGV[1] ; # read the path to the second file print "First file : $firstFile\n" ; # print the read pathes print "Second file: $secondFile\n" ;