Show quoted text>>>>> "shvR" == steven haryanto via RT <bug-File-Slurp@rt.cpan.org> writes:
Show quoted text
Show quoted text shvR> On Fri Nov 19 01:22:49 2010, uri@stemsystems.com wrote:
shvR> Adding something like 'autochomp' option would certainly
Show quoted text >> convenient:
>>
Show quoted text shvR> read_file('foo.txt', autochomp => 1).
Show quoted text >>
>> that is in my todo queue. a new release is due soon with a lot of
>> fixes
>> and interesting improvements. that one will go into the next release.
Show quoted text shvR> Nice to know that a new release is imminent!
i need to finish up some cleaning up of a couple of tests and docs. but
it still takes time i don't seem to have!
Show quoted text >> the problem with your idea is how do you autochomp multiple lines when
>> slurping to a scalar? so that option will only work if you slurp to an
>> array or array ref.
Show quoted text shvR> You don't. In a scalar context, we can just chomp the whole file once.
shvR> That makes perfect sense for one-line files in my case, and doesn't
shvR> make much sense in a multiple-line files anyway. Of course we can chomp
shvR> each line in array context.
well, i can enable it for scalars but it will only make sense for one
line files. i will doc it that way.
uri
--
Uri Guttman ------ uri@stemsystems.com --------
http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Gourmet Hot Cocoa Mix ----
http://bestfriendscocoa.com ---------