i am a beginner, i want to make a program that takes any command line arguments... and print it out in reverse.
ie. if the command line argument is "thanks for helping me"
i want it to output "me helping for thanks"
i have tried using the reverse command, but i cant get it working!!
thanks
post what u tried so far
---------- Post updated at 10:03 AM ---------- Previous update was at 10:02 AM ----------
and let us know the logic what u have used
thanks for reply itkamaraj
so far i have tried this, but i dont think it is right!!
#!/usr/bin/perl
REVERSE_LIST = reverse (@ARGV);
print "command line argument in reverse: $REVERSE_LIST" . "\n";
You need to define "REVERSE_LIST" as an array with a "@" symbol.
#!/usr/bin/perl
@REVERSE_LIST = reverse (@ARGV);
print "command line argument in reverse: @REVERSE_LIST" . "\n";