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

If you want to empty an array then how would you do that?

589


Explain goto label?

531


What is a perl references?

538


Who created perl?

539


What does redo statement do in perl?

552






I have one question regarding to eval function. I know eval function is use for error checking but I am not able to understand below line. eval \'exec perl -S $0 ${1+\"$@\"}\' if 0; $0 for script name $@ set if error occur

1620


how to get back up from private character editor which is saved in the format of .udf

1866


What happens when you return a reference to a private variable?

541


Explain the default scope of variables in perl?

532


How to convert strings into an array in perl?

528


Explain the difference between "my" and "local" variable scope declarations. ?

577


What are the two ways to get private values inside a subroutine?

466


What is the use of -n and -p options?

616


What is the peculiarity of returning values by subroutines in perl?

496


Can you add two arrays together?

539