Data::Constraint is an alternative if you are thinking to add more different 
types of constraints.
On 25 Feb 2014, at 22:36, Bill McCormick <wpmccorm...@gmail.com> wrote:

> On 2/25/2014 4:30 PM, Bill McCormick wrote:
>> What would be the perl'ish way using map or some other sugar to check if
>> a list of values meet some criteria? Instead of doing something like
>> 
>> my @issues = qq(123,456,a45);
>> my $max = 999;
>> 
>> for (@issues) {
>>   die if $_ < 0 or $_ > $max;
>> }
>> 
> Revision:
> 
> for(@issues) {
>  print "issue=[$_]\n";
>  die "$_ not a number\n" if $_ ne $_+0;
>  die "$_ not in range\n" if $_ < 0 || $_ > $max;
> }
> 
> 
> 
> ---
> This email is free from viruses and malware because avast! Antivirus 
> protection is active.
> http://www.avast.com
> 
> 
> 
> -- 
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> For additional commands, e-mail: beginners-h...@perl.org
> http://learn.perl.org/
> 
> 


--
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