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 to convert arrays into a string in perl?
Explain which feature of PERL provides code reusability?
How do you give functions private variables that retain their values between calls?
Explain arrays in perl.
Comment on array slicing and range operator
Explain split function in perl?
Explain join function in perl?
How many data types are there in perl?
Create a function that is only available inside the scope where it is defined ?
Elaborate on perl bite-wise operators.
What are arrays in perl?
What is grep used for in perl?
What are perl strings?
How do I send e-mail from a Perl/CGI program on a Unix system?
You want to concatenate strings with perl. How would you do that?