The easiest way to get paramters via Console, is to use the Getopt
Module.
You can find further informations about that here:
For example:
use Getopt::Long;
my $data = "bin_file";
my $length = 24;
my $verbose;
GetOptions ("length=i" => \$length, # numeric
"file=s" => \$data, # string
"verbose" => \$verbose
) # flag
or die("Error in command line arguments\n");
Then you can call your script (inside your shell) with:
$ perl script.pl --length 14 --file test.dat --verbose
Getopt
parses the command line from @ARGV
, recognizing and removing specified options and their possible values.