perlquestion
kalyanrajsista
<P>Monks,</P>
<P>I'm confused of how to use the references in conditional statements like </P>
<code>
#!/usr/bin/perl
use strict;
my $hash_ref = &getHashRef();
# Check if hash reference has really values in it....
if ( $hash_ref ) {
.....# do something
}
</code>
<P>I want to do the processing only if there is data inside the $hash_ref. eventhough there is no data inside the hashref, it is going into the loop, which it should not be.</P>
<P> I'm trying the following ways. ..
<code>
# Which one is correct .....
if ( %$hash_ref ) {
......
}
# OR
if ( $hash_ref ) {
........
}
</code>
<P> Also please provide me check for existence of values inside Array references.....</P>