On Mon, Jun 04, 2012 at 11:30:30AM -0500, Chris Stinemetz wrote:
> I have a subroutine that I want to "return 1" only if the value of
> %{$href->{$_[0]}} is equal to 'ND' for the whole 24 occurences.
> 
> Any suggestions is greatly appreciated.
> 
> Thank you,
> 
> Chris
> 
> sub site_offAir {
>   for (values %{$href->{$_[0]}}) {
>     return 1 if $_ eq 'ND'; #need to test all values are eq to 'ND'
>   }
>   return '';
> }

I would imagine it to be much easier to look at it from the other way.
Return 0 any time you find a value that does not equal "NO".  Then
return 1 at the end.

-- 
Paul Johnson - p...@pjcj.net
http://www.pjcj.net

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to