in reply to New user, confusion over print and lists
$_ = "dlrow ,eerhT"; print reverse $_; # No output, list context
you get the one-element list ($_) reversed, which is the same list. Harder to spot since you forgot the newline this time.
reverse does exactly like documented and explained by choroba
I think you are misunderstanding how context works, it's the LHS which decides how the RHS of reverse is interpreted and print always induces list context.
Cheers Rolf
( addicted to the Perl Programming Language)
|
|---|