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 is the difference between use and require in perl?
How to remove a directory in perl?
Explain cpan?
What is “grep” function in perl?
Where the command line arguments are stored and if you want to read command-line arguments with Perl, how would you do that?
How to create a directory in perl?
What happens in dereferencing?
For a situation in programming, how can you determine that Perl is a suitable?
What are scalars in perl?
What does 'do' statement do in perl?
Explain about typeglobs?
What does cgi program store?
What does next statement do in perl?
How can I display all array element in which each element will display on next line in perl ?
What is perl? What is the basic command to print a string in perl?