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 interpreter is used in perl?
What $! In perl?
How to read from a pipeline with Perl
what is Chop & Chomp function does?
Why should I use the -w argument with my Perl programs?
Explain chomp?
What does a die() function do in perl?
How do I sort a hash by the hash value?
How can I implement the function overloading in Perl ? I read about the operator overloading, I do not know how to implement the function overloading. Thanks in advance ?
What are the logical operators used for small scale operations? Explain them briefly.
What does the’$_’ symbol mean?
How will you create a file in perl?
How to convert arrays into a string in perl?
List all the features of perl programming?
Show the use of sockets for the server and client side of a conversation?