Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 164
  • Last Modified:

I am trying to do this in Perl

Write a program that takes a string of text, stores it in a control structure and does the following?
i.      Prints it forward
ii.      Prints it backwards
iii.      Prints it without the first element
iv.      Adds a new element to the front and prints
0
1030071002
Asked:
1030071002
  • 3
  • 2
2 Solutions
 
ozoCommented:
print $text;
print scalar reverse $text;
print substr $text,1;
print $text=$new.$test;
0
 
1030071002Author Commented:
did not work
print $text=$new.$test;
0
 
1030071002Author Commented:
$text = "Reynard is the greatest Programmer in the world\n";
print $text;
print "\n";
print scalar reverse $text;
print "\n";
print substr $text,1;
print "\n";
print $text=$new.$test;
0
 
ozoCommented:
$new = "element";
print $text=$new.$text;
0
 
1030071002Author Commented:
Thank you so much mabe you can help me with the others
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now