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
How many types of variable in perl?
How to connect with sqlserver from perl and how to display database table info?
Which guidelines by Perl modules must be followed?
How does a “grep” function perform?
Explain lists ?
What is the different between array and hash in perl programming?
What is the purpose of _package_ literal?
Does Perl have reference type?
How to prevent file truncation in perl?
How to implement a stack in Perl?
Suppose an array contains @arraycontent=(‘ab’, ‘cd’, ‘ef’, ‘gh’). How to print all the contents of the given array?
Give an example of using the -n and -p option.
How do you you check the return code of a command in perl?
what is the function that is used to identify how many characters are there in a string?
Which functions in Perl allows you to include a module file or a module and what is the difference between them?