Learning Perl 学习笔记
1.文件读写与命令行参数#!/usr/bin/perl
use strict;
if (@ARGV < 2){
die"USAGE: perl $0 inputfile outfile\n";
}
my ($infile) = @ARGV;
my ($outfile) = @ARGV;
open my $infile_fh,'', "$infile" || die("Can't open the file!");
open my $outfile_fh, '>>', "$outfile"|| die("Can't open the file!");
while(){
#chomp;
print $outfile_fh$_;
}
close($outfile_fh);
close($infile_fh);
页:
[1]