<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>For some other possibilities, see the List::Util module, which has "any" and "all".</div><div><br></div><div>use List::Util qw( any );</div><div>my $has_a_value = any { defined } values %{ $input_hash };<br><br>Though it is a core module, those functions have been added more recently, so unless you have a modern Perl, you may need to update the List::Util module from CPAN.</div><div><br>Doug Bell<div><a href="mailto:preaction@me.com">preaction@me.com</a></div></div><div><br>On Aug 5, 2015, at 1:05 PM, Andy Lester <<a href="mailto:andy@petdance.com">andy@petdance.com</a>> wrote:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><br class=""><div><blockquote type="cite" class=""><div class="">On Aug 5, 2015, at 1:01 PM, Richard Reina <<a href="mailto:gatorreina@gmail.com" class="">gatorreina@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="font-family:Georgia;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="">my $input_hash = { <span class="Apple-converted-space"> </span><br class="">      <span class="Apple-converted-space"> </span><br class="">       FName => param('firstname'), <span class="Apple-converted-space"> </span><br class="">       LName => param('lastname'),<br class="">       Email => param('email'),<br class=""><br class="">   };<br class="">  <span class="Apple-converted-space"> </span><br class=""></div><span style="font-family:Georgia;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important" class="">Can I check to see if any of the hash's element is defined without checking all the elements as the hash could grow in the future as the fields of the form grow.</span></div></blockquote></div><div class=""><br class=""></div><div class="">grep through the values and check their count.</div><div class=""><br class=""></div><div class="">my $number_of_defined_values = scalar grep { defined } values %{$input_hash};<br class=""><br class=""></div><div class="">
--<br class="">Andy Lester => <a href="http://www.petdance.com" class="">www.petdance.com</a>

</div>
<br class=""></div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Chicago-talk mailing list</span><br><span><a href="mailto:Chicago-talk@pm.org">Chicago-talk@pm.org</a></span><br><span><a href="http://mail.pm.org/mailman/listinfo/chicago-talk">http://mail.pm.org/mailman/listinfo/chicago-talk</a></span></div></blockquote></body></html>