my @array = reverse( LIST );
In scalar context:
my $value = reverse( LIST );
Fine. But it does not say how it's supposed to behave when fed a SCALAR instead of a LIST, does it?
I'm still confused.
| [reply] [d/l] [select] |
Erm . . . a LIST may consist of a single scalar value. That single scalar value is concatenated with all the other elements in the LIST (very quickly, obviously, since they're non-existent) and the bytes in that concatenated string (i.e. the single scalar argument) are returned in reverse order, just like the docs say.
The cake is a lie.
The cake is a lie.
The cake is a lie.
| [reply] |
Then tell me why this prints hello and not olleh?
$ perl -wle 'print reverse(q{hello})'
hello
| [reply] [d/l] [select] |