Write a script to reverse a string without using Perl's
built in function
Answer Posted / pallavi w
#!/usr/bin/perl -w
2
3 use strict;
4 my $string = "STRING";
5 my $rev_string = join "", reverse (split ("", $string));
6
7 print "The String is ". $string ."\n";
8 print "The reverse string is ". $rev_string ."\n";
| Is This Answer Correct ? | 4 Yes | 8 No |
Post New Answer View All Answers
Write syntax to use grep function?
Is perl compiler or interpreter?
Explain split function in perl?
Which functions in perl allows you to include a module file. State their differences.
What is eval function in perl?
How to connect with sqlserver from perl and how to display database table info?
What is the use of 'ne' operator?
How are parameters passed to subroutines in perl?
How to check the status of airplane mode (enable/disable) in perl for Android mobile?
If EXPR is an arbitrary expression, what is the difference between $Foo::{EXPR} and *{"Foo::".EXPR}?
What syntax is used for grep() function?
What is cpan in perl?
How can memory be managed in Perl?
What are the different string manipulation operators in perl?
how to create a flat file database as shown below s.no name age city phone 0 hema 22 Calcutta 4312542 1 hema 21 Bangalore 2344345 2 ganesh 25 delhi 2445454 3 kartik 45 pune 4312121 4 santosh 25 Hyderabad 2254231 5 kumar 25 mysore 2344567 6 gita 34 mangalore 6532123 7 gita 32 pune 2213456 Q1.print the details of the person who r from bangalore q2.Replace the city name managlore to pune q3.prints no of person having name gita and hema q4.print how many are of age 25.