#!/usr/bin/perl use strict; my $hash_ref = &getHashRef(); # Check if hash reference has really values in it.... if ( $hash_ref ) { .....# do something } #### # Which one is correct ..... if ( %$hash_ref ) { ...... } # OR if ( $hash_ref ) { ........ }