develooper Front page | perl.perl5.porters | Postings from May 2008

[perl #39187] [DOC-PATCH]: perldoc -f reverse: examples (was: RE: Perlfunc needs to be made more clear regarding reverse in scalar context.)

Thread Next
From:
Bram via RT
Date:
May 17, 2008 02:44
Subject:
[perl #39187] [DOC-PATCH]: perldoc -f reverse: examples (was: RE: Perlfunc needs to be made more clear regarding reverse in scalar context.)
Message ID:
rt-3.6.HEAD-9880-1210974244-1717.39187-15-0@perl.org
On Tue May 23 02:34:11 2006, theodore@websitters.com wrote:
> Perlfunc gives these as examples of reverse:
> 
> print reverse <>;           # line tac, last line
> first
> undef $/;                   # for efficiency of <>
> print scalar reverse <>;    # character tac, last line
> tsrif
> 
> This is very clear for using reverse in list context,
> but not so clear for reversing the characters in the
> list, and very unclear regarding reversing a string.
> I've read this many times, but didn't realize that you
> could reverse a string until someone told me today. Is
> there any way you can add a line to make this more
> clear? Perhaps something like:
> 
> print scalar reverse $_;
> 
> Thank you for your attention to this matter.
> -Ted
 

Patch that changes the examples in perlfunc/reverse attached.


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About