From: Rafael Garcia-Suarez Date: Fri, 30 Jan 2004 08:29:55 +0000 (+0000) Subject: Another undocumented use of $_ : with reverse(). X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2d713cbdb46b509890c04ac2e5b1893a8fac1914;p=p5sagit%2Fp5-mst-13.2.git Another undocumented use of $_ : with reverse(). p4raw-id: //depot/perl@22248 --- diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index f3a0adf..32e33aa 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -4254,6 +4254,8 @@ in the opposite order. undef $/; # for efficiency of <> print scalar reverse <>; # character tac, last line tsrif +Used without arguments in scalar context, reverse() reverses C<$_>. + This operator is also handy for inverting a hash, although there are some caveats. If a value is duplicated in the original hash, only one of those can be represented as a key in the inverted hash. Also, this has to