http://www.perlmonks.org?node_id=984871


in reply to Space in getopt option value

Here is one way:
use warnings; use strict; use Getopt::Long; use Data::Dumper; $Data::Dumper::Sortkeys=1; my %opt; GetOptions(\%opt, 'foo=s') or die; print Dumper(\%opt); __END__ myhack.pl --foo 'bar1 bar2 bar3' $VAR1 = { 'foo' => 'bar1 bar2 bar3' };
The you can process $opt{foo} if you wish.