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

Explain lexical variables.

521


Differentiate use and require?

529


what is perl language?

516


“The methods defined in the parent class will always override the methods defined in the base class”. What does this statement means?

535


What are the various advantages and disadvantages of perl?

471






What does undef function in perl?

525


Which statement has an initialization, condition check and increment expressions in its body? Write a syntax to use that statement.

548


What is the use of "stderr()"?

571


what is the function that is used to identify how many characters are there in a string?

541


What is the difference between perl array and perl hash?

523


What is the purpose of “_file_ literal” and “_line_ literal” in perl?

539


Which operator in perl is used for the concatenation of two strings?

500


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

537


Write a program that explains the symbolic table clearly.

536


What are perl variables?

528