Getopt-Mixed

 view release on metacpan or  search on metacpan

lib/Getopt/Mixed.pm  view on Meta::CPAN

sub getOptions
{
    &init if $#_ >= 0;        # Pass arguments (if any) on to init

    # If you want to use $RETURN_IN_ORDER, you have to call
    # nextOption yourself; getOptions doesn't support it:
    $order = $PERMUTE if $order == $RETURN_IN_ORDER;

    my ($option,$value,$package);

    $package = (caller)[0];

    while (($option, $value) = nextOption()) {
        $option =~ s/\W/_/g;    # Make a legal Perl identifier
        $value = 1 unless defined $value;
        my $code = "\$" . $package . "::opt_$option = \$value;";
        $code =~ /(.+)/;        # Untaint it
        eval $1;
    } # end while

    cleanup();



( run in 1.787 second using v1.01-cache-2.11-cpan-1e74a51a04c )