In Perl, the command line arguments are stored in the @ARGV array. $#ARGV can get the number of arguments.
#!/usr/bin/perl
if ($#ARGV == 0) {
die("Not enough arguments!");
}
$input = shift @ARGV;
open FILE, ">$input.txt" or die("Can't open input file: $!");
You need to open the file, read the entire file, and print out all EXCEPT the first line to the desired output file.
open INFILE, '<infile';
open OUTFILE, '>outfile';
<INFILE>; #discards first line
print OUTFILE $_ while (<INFILE>);
close OUTFILE;
close INFILE;
You need to open the file, read the entire file, and print out all EXCEPT the first line to the desired output file.
open INFILE, '<infile';
open OUTFILE, '>outfile';
<INFILE>; #discards first line
print OUTFILE $_ while (<INFILE>);
close OUTFILE;
close INFILE;
You need to open the file, read the entire file, and print out all EXCEPT the first line to the desired output file.
open INFILE, '<infile';
open OUTFILE, '>outfile';
<INFILE>; #discards first line
print OUTFILE $_ while (<INFILE>);
close OUTFILE;
close INFILE;
In Perl, the command line arguments are stored in the @ARGV array. $#ARGV can get the number of arguments.
#!/usr/bin/perl
if ($#ARGV == 0) {
die("Not enough arguments!");
}
$input = shift @ARGV;
open FILE, ">$input.txt" or die("Can't open input file: $!");
In Perl, the command line arguments are stored in the @ARGV array. $#ARGV can get the number of arguments.
#!/usr/bin/perl
if ($#ARGV == 0) {
die("Not enough arguments!");
}
$input = shift @ARGV;
open FILE, ">$input.txt" or die("Can't open input file: $!");
You need to open the file, read the entire file, and print out all EXCEPT the first line to the desired output file.
open INFILE, '<infile';
open OUTFILE, '>outfile';
<INFILE>; #discards first line
print OUTFILE $_ while (<INFILE>);
close OUTFILE;
close INFILE;