in reply to Space in getopt option value

Are you passing multiple values to the --foo argument or one string value with spaces? If the former, you can use something like this:
myhack.pl --foo bar1 --foo bar2 --foo bar3

Be sure to change GetOptions ("foo=s" => \$foo); to GetOptions ("foo=s" => \@foo);

see: Options with multiple values