in reply to How to reverse a string *revisited*

What puts things in list context is print, not the arguments themselves in print reverse $str;. The scalar builtin puts its argument in scalar context. Try print scalar reverse $str;

After Compline,
Zaxo

Replies are listed 'Best First'.
Re: How to reverse a string *revisited*
by Abigail-II (Bishop) on Nov 12, 2003 at 01:08 UTC
    Yeah, and compare the subtle difference between the following two lines:
    print "", reverse $str; print "". reverse $str;

    Abigail