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

Answer Posted / digesh patel

if($ipaddress=~m\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b)
print "\n It is a valid IP address :";

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 the difference between perl array and perl hash?

517


What is perl push array function?

540


How do you find the length of an array?

550


What is a chomp() function in perl?

511


When do you use perl programming?

583






How do I send e-mail from a Perl/CGI program on a Unix system?

582


What is the use of now constructor in perl?

522


What are the arguments and what do they mean in perl programming?

517


What is the difference between localtime() and gmtime() functions?

537


How to copy a file in perl?

508


How are parameters passed to subroutines in perl?

497


What is the difference between use and require in perl programming?

509


Write a program to download the contents from www.perlinterview.com/answers.php website in Perl.

534


What is the difference between die and exit in perl?

561


Which functions in Perl allows you to include a module file or a module and what is the difference between them?

523