On 2012-08-29, at 12:46 PM, Ashwin Rao T <ashwin...@gmail.com> wrote: > 1)Check if IP address is in the range 172.125.1.0 and 172.125.25.0 > using only return functions & regular expressions in Perl.
/\b172\.125\.(\d+)\.((?>\d+))(??{(1<=$1 && $1<=24 && 0<=$2 && $2<=255)|| ($1==25 && $2==0) ? "" : "(*FAIL)"})/ and say "Strictly correct answer that shows instructor didn't think about the question" Do let us know what grade that gets you :-) -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/product.aspx?isbn=0137001274 http://www.oreillyschool.com/certificates/perl-programming.php -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/