Help for this page

Select Code to Download


  1. or download this
    use B qw( svref_2object SVt_PVHV );
    sub is_hash {
        my $ref = shift @_;
        return ref( $ref )
            and svref_2object( $ref ) & SVt_PVHV;
    }
    
  2. or download this
    sub does_hash {
        my $ref = shift @_;
        return ref( $ref )
            and eval { %$ref; 1 };
    }