in reply to Re: Getting selected options from GetOptions()
in thread Getting selected options from GetOptions()

The problem is that , there are more than 30 options, and I dont want to write like 30 if statements to get the selected options. Is there any effective way to find this?

Thanks,
Tom
  • Comment on Re^2: Getting selected options from GetOptions()

Replies are listed 'Best First'.
Re^3: Getting selected options from GetOptions()
by zwon (Abbot) on Dec 16, 2009 at 20:54 UTC

    Using runrig's example:

    my %opts; GetOptions(map { ($_ => \$opts{$_}) } "a".."z"); my @selected = grep { $opts{$_} } keys %opts;
Re^3: Getting selected options from GetOptions()
by Anonymous Monk on Dec 16, 2009 at 20:47 UTC
    Thanks much.
    -Tom