protoplasm schreef:

> foreach (keys %opts_hash)
> {
>   if ( !defined $opts_hash{$_} )
>   {
>     next;
>   }
>   elsif ( $opts_hash{$_} == 1 )
>   {
>     print "$_ = $opts_hash{$_}\n";
>   }
> }

An alternative way to write that:


for (sort keys %opts_hash) {
    next unless defined $opts_hash{$_};

    print "$_ = $opts_hash{$_}\n"
        if 1 == $opts_hash{$_};
}

I used sort to get them to print in a more predictable order. 

-- 
Affijn, Ruud

"Gewoon is een tijger."

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to