#!/usr/bin/perl # (use a unix/linux style shebang line, # because someday you will want to use a unix/linux system) use strict; my $reqd_param_count = 2; # (e.g. two file names) if ( ! @ARGV ) { # prompt for interactive input of required parameter(s) ... } elsif ( @ARGV == $reqd_param_count ) { # invoked from an interactive shell: required params are in @ARGV ... } else { die "Usage: $0 arg1 ...\n"; }