Ah. That explains a great deal. If you really want/expect the script to work when it gets launched by clicking on the file's icon in a file browser, consider the following idiom:
But seriously, there ought to be a sensible way to set things up so that a user can easily invoke a perl script with args (that will go into @ARGV). If not, just please switch to some sort of GUI approach (Tk, wx, etc), or else get cozy with using a CLI shell ("bash" is available for windows, and is the best, IMHO).#!/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"; }
In reply to Re^3: MD 5 hash comparison/checker
by graff
in thread MD 5 hash comparison/checker
by daggy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |