Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Space in getopt option value

by toolic (Bishop)
on Aug 01, 2012 at 18:32 UTC ( #984871=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://984871]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (11)
As of 2016-12-02 20:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (50 votes). Check out past polls.