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 does `$result = f() .. g()' really return?

564


Is perl compiler or interpreter?

535


Differentiate use and require?

519


What does perl do in linux?

529


Explain gmtime() function in perl?

559






Why do you use Perl?

541


What are the various perl data types based on the context?

533


Write syntax to add two arrays together in perl?

538


what is Chop & Chomp function does?

593


Define dynamic scoping.

499


What are the logical operators used for small scale operations? Explain them briefly.

535


How will you open a file in a write-only mode in perl?

474


What are arrays in perl?

553


What are perl variables?

513


“Perl regular expressions match the longest string possible”. What is the name of this match?

525