in reply to No arguments or filenames

You can do something like my $usage = qq(Usage text); die $usage if !@ARGV; You could also make usage a sub and call it when @ARGV is empty: You should also check out GetOpt::*