Write an expression or perl script to identify the entered
ip address is valid or not?

Answer Posted / subhash chandran

if($IP !~ /(((\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])\.){3}(\d|
[1-9]\d|1\d{2}|2[0-4]\d|25[0-5]))/)
{
print "Valid\n";
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is perl dbi?

505


What does -> symbol indicates in Perl?

580


What are prefix dereferencer? List them.

575


Comment on the scope of variables in perl.

533


Comment on array slicing and range operator

533






Explain lists and ivalue?

577


What is use of ‘->’ symbol?

554


Which guidelines by Perl modules must be followed?

586


What is perl? What is the basic command to print a string in perl?

504


How do I do fill_in_the_blank for each file in a directory?

554


What is chomp() operator/function?

576


You want to download the contents of a url with perl. How would you do that?

511


How to close a file in perl?

502


Perl regular expressions are greedy" what does this mean?

512


What is 'rollback' command in perl?

556