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
How do I replace every TAB character in a file with a comma?
What is cpan in perl?
What are the advantages of programming in perl?
What are stdin, stdout and stderr?
How to prevent file truncation in perl?
What are the various flags/arguments that can be used while executing a perl program?
Explain the internal working of cgi
What are the different ways to run cgi?
what are the three groups involved in information sharing?
What is the difference between use and require in perl programming?
Perl regular expressions are greedy" what does this mean?
What is 'commit' command in perl?
How to read a single line from a file in perl?
How do you turn on the perl warnings?
How will you create a file in perl?