Make that
say chop $str while length $str;
Otherwise if the string starts with 0, the last iteration will be omitted, because Perl considers the string 0 to be false.
In reply to Re^2: Read a variable backwards..
by moritz
in thread Read a variable backwards..
by sathya83aa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |