how to find a substring in a string without using substr
built in functions, and print the substring found
Answer Posted / garg
#! /user/bin/perl
$str="Yashwanth";
$n="wan";
if ($str=~ $n)
{
print $n;
}
| Is This Answer Correct ? | 4 Yes | 6 No |
Post New Answer View All Answers
How to sort arrays in perl?
Explain the execution of a program in perl.
What are the steps involved when the cgi program starts running?
Write an example explaining the use of symbol tables.
Which has highest precedence in between list and terms? Explain?
Explain substr function in perl?
How do I sort a hash by the hash key?
What is the purpose of goto expr statement?
“Perl regular expressions match the longest string possible”. What is the name of this match?
How do I send e-mail from a Perl/CGI program on a Unix system?
What does Perl do if you try to exploit the execve(2) race involving setuid scripts?
Explain strftime() function in perl?
Write a script to reverse a string without using perl's built in functions?
What is the use of "stderr()"?
How to code in perl to implement the tail function in unix?