Help for this page

Select Code to Download


  1. or download this
    my @keys_to_process = $x eq 'key_1'       ? keys %my_hash
                        : exists $my_hash{$x} ? ($x)
    ...
    foreach $key (@keys_to_process) {
        do_something_with($key);
        }
    
  2. or download this
    my @keys_to_process = ! exists $my_hash{$x} ? ()
                        : $x eq 'key_1'         ? keys %my_hash
                        :                         ($x)
                        ;