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 read command-line arguments with Perl?
How to replace perl array elements?
What is perl I used for?
Define say() function in perl?
Show the use of sockets for the server and client side of a conversation?
Perl regular expressions are greedy" what does this mean?
Enlist the advantages of using c over perl?
What happens when you return a reference to a private variable?
Which functions in perl allows you to include a module file. State their differences.
What does length(%HASH) produce if you have thirty-seven random keys in a newly created hash?
what is perl language?
Write a program to decode the data in the form using cgi programming
What are perl strings?
Explain the difference between declarations of 'my' and 'local' variable scope in perl?
What are scalars in perl?