Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Space in getopt option value

by toolic (Chancellor)
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.


Comment on Re: Space in getopt option value
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://984871]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2014-08-30 16:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (293 votes), past polls