I have a string which contains numerical values. I want to display the numerical values in reverse order.
An idea that doesn’t work is to use the built-in reverse function:
my $j = "12,11,10,9";
my $k = reverse($j);
print $k;
But that code outputs:
9,01,11,21
When we want:
9,10,11,12
Concise version:
Parentheses version:
If I decompose it a bit:
OUTPUT
NOTE
perldoc -f reverse