Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    
    if ( %{ $data->{foo} } ) { ... }   # ok, because $data->{foo} is a has
    +href
    if ( %{ $data->{bar} } ) { ... }   # not ok, because $data->{bar} is e
    +mpty
    
  2. or download this
    if ( ref($data->{bar}) eq "HASH" ) { ... }   # ok, even if $data->{bar
    +} is empty/undef
    
  3. or download this
        ...
        next unless ref($coordinates->{$group}{$id}{$stage}{"coords"}) eq 
    +"HASH";
    
        # print individual and coordinate information