in reply to Passing a String

I'm glad you figured out how to do what you need, but for completeness, I'll add that you can quote the string and access it as a single element (instead of slurping all of @ARGV):

use warnings; use strict; if (! defined $ARGV[0]){ print "Usage: ./script.pl \"multi word quoted string here\"\n"; exit; } my $string = $ARGV[0]; print "$string\n"; __END__ $ ./str.pl "hello, world!" hello, world!

Update: I was about to write up an example using Getopt::Long, but found that toolic had already written an example using it a couple of years ago. With Getopt::Long, you have the ability to add optional arguments later, unambiguously.