There is definitely more than one way to handle arguments that are supplied to your script. The way you describe above, including the text in double quotes, does count as one argument because of the quotes. So, if you take this code:
-
use strict;
-
use warnings;
-
use Getopt::Std;
-
-
my $no_of_args = $#ARGV + 1;
-
-
print("There were $no_of_args arguments supplied to this script. \n");
-
and run it using Perl, supplying however many arguments you want, you will find that it will tell you how many you supplied. You would access those supplied elements using the array @ARGV. (If you are on a Linux/Unix machine, be sure to add the #!/usr/bin/perl line to the beginning of the script before running it)
There are other ways of handling arguments though, and one of those is using the Getopt module(s). There are different Getopt modules, such as Getopt::Long and
Getopt::Std (which is one of my favorites).
You would use one of those modules if you wanted to define options, such as "-a", "-r", etc, for your users to define for whatever they want to supply to the script.
Regards,
Jeff