tags:

views:

291

answers:

1

Hi guys.

I've been playing around with the Getopt::Std module and was wondering about arguments taking spaces.

I have this code atm: getopts('dp:h', \%options);

The problem is, that if the argument following the p flag contains a space, getopts stops processing the list right when it hits the space. Is there a way I can allow spaces in the arguments without having to wrap the arguments following the flag in quotes (-p "something something")?

I'm fine with quotes. I'm just curious. Thanks guys!

+2  A: 

Take a look here, someone did a lot of experimenting ..

and this page indicates that Double Quotes " char(34) will work, if you have spaces embedded, thus implying that there is no other way ..

lexu