> -----Original Message-----
> From: p sena [mailto:senapati2...@yahoo.com]
> Sent: 03 March 2011 15:40
> To: perl-win32-users@listserv.ActiveState.com; Brian Raven
> Subject: RE: regex like option *values*
>> __DATA__
>> abc0[1-9].ctr.[pad,spd].set.in
>> abc[01-22].ctr.[pad,spd].set.in
>> abcL[1,2,3].ctr.[pad,spd].set.in
>> abcL[1,2,3].ctr.[pad,spd].set.in
>> abcL[1,2,3].ctr.[70,001].set.in
>> ---------------------------------------------------
>>
>> It should work for lists of ranges, and ranges of strings as well as
>> numbers.
>>
>> Regarding incorporating into Getopt::Long, see the Tips and Tricks
>> section of the doco.
>>
>> HTH
>> --
>> Brian Raven
>
> Thanks Brian,
>
> This solution should work only for brackets irrespective of numbers or
> strings inside them right? The curly braces are not required it seems.
>
> This feature is not there in Getopt::Long and can this be implemented
> in it or it is configurable from it?

As I said, see 'perldoc Getopt::Long'. A small change to the suggestion in 
"Tips and Techniques" would look like..

GetOptions('option_name=s%' =>
               sub { push(@{$list{$_[1]}}, expand_string($_[2])) });

I haven't tried it but it looks like it should work.

HTH


--
Brian Raven




Please consider the environment before printing this e-mail.

This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient or have received this e-mail in error, please advise 
the sender immediately by reply e-mail and delete this message and any 
attachments without retaining a copy.

Any unauthorised copying, disclosure or distribution of the material in this 
e-mail is strictly forbidden.
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to