Hi,
I am working on a perl script, were a program is given a file, another file and a deviation (a number) as input on the command line. I also wants the program to complain when its too many arguments , it should just be to filenames followed by a number!!!
I have done that but it will not work probably :
#!/usr/bin/perl -w
use strict;
my ($file1, $file2, $deviation) = @ARGV ;
sub usage {
my ($msg) = @_;
print "$msg \n\n" if defined $msg;
print "Usage: project.pl <file1> <file2> <deviation>\n";
exit;
}
&usage if ( scalar @ARGV != 3){
else {
die "Too many arguments\n";
}
__END__
thanx alot :)