how to find a substring in a string without using substr
built in functions, and print the substring found
Answer Posted / lucky
#!/usr/bin/perl
print"enter string
";
$str=<stdin>;
print"enter substring
";
$substr=<stdin>;
if($str=~$substr){
print"valid
";
}
else
{
print"invalid
";
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are the advantages of perl programming?
Explain lists and ivalue?
What are the various file operations in perl. Explain with example.
Write syntax to add two arrays together in perl?
Explain what is perl language?
What is stdin in perl?
How to concatenate strings in perl?
What are the various perl data types based on the context?
List the operator used in Perl?
What is the use of -t?
How do you find the length of an array?
What does localtime() do in perl?
Write a program that shows the distinction between child and parent process?
Explain perl. When do you use perl for programming?
How do I print the entire contents of an array with Perl?