Re: [PATCH 1/5] gitweb: Add a comment explaining the meaning of $/
- From
Jakub Narębski <jnareb@gmail.com>
- Date
- Dec 4, 2013, 17:34 UTC
- Message-ID
- <CANQwDwfiYAz7dro9mppR62xEFMPTSNjEKYM=7Dhq7auBvyXjSg@mail.gmail.com>
- In-Reply-To
- <1386171977.2173.23.camel@localhost.localdomain>
On Wed, Dec 4, 2013 at 4:46 PM, Krzesimir Nowak <krzesimir@endocode.com> wrote:
Show 11 quoted lines
> On Wed, 2013-12-04 at 16:11 +0100, Jakub Narębski wrote: >> On Wed, Dec 4, 2013 at 2:42 PM, Krzesimir Nowak <krzesimir@endocode.com> wrote: >> >> > So future reader will know what does it mean without running "perldoc >> > perlvar". >> >> Hmmm... shouldn't future reader know it anyway? It is not that cryptic. >> I'd say it is idiomatic Perl. > > It's plainly obscure. And I think it is not that often used - I keep > forgetting what that pair of punctuation is actually meaning.
I think it depends on what kind of Perl code one is used to. It is not as obscure as $; and similar to $|, I think.
> In this case I guess it would be more readable to use the following code
> instead:
>
> $fh->input_record_separator ("\0");That would be a good change to replace
local $/ = "\0";
open my $fh, "-|", git_cmd(), ..., '-z', ...
with
open my $fh, "-|", git_cmd(), ..., '-z', ...
$fh->input_record_separator ("\0");(not forgetting about "use IO::Handle", which module is core Perl module);
Anyway, this change (or proposed change) does not, IMHO, belong in this series.
-- Jakub Narebski