You could use chop if you don't need to retain the string.
$ perl -E ' $str = q{abcdefg}; say chop $str while $str;' g f e d c b a $
I hope this is helpful.
Cheers,
JohnGG
In reply to Re: Read a variable backwards..
by johngg
in thread Read a variable backwards..
by sathya83aa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |