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

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

Thread Previous
From:
demerphq
Date:
May 17, 2008 03:05
Subject:
Re: [perl #39187] [DOC-PATCH]: perldoc -f reverse: examples (was: RE: Perlfunc needs to be made more clear regarding reverse in scalar context.)
Message ID:
9b18b3110805170305x2bdb180eu580b34f01ecd1294@mail.gmail.com
2008/5/16 Bram via RT <perlbug-followup@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.


Thanks. Applied as 33840.

http://public.activestate.com/cgi-bin/perlbrowse/p/33840

Cheers,
yves


-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

Thread Previous


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