Re: [PATCH v4 1/2] Documentation: fix linkgit references
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- May 4, 2016, 21:54 UTC
- Message-ID
- <CACBZZX4dYjHETCyMFQngBKoS80gkmcAZKKYc0VkE0ufaAg-gZg@mail.gmail.com>
- In-Reply-To
- <20160504200635.GA22787@sigill.intra.peff.net>
On Wed, May 4, 2016 at 10:06 PM, Jeff King <peff@peff.net> wrote:
Show 11 quoted lines
> Would:
>
> open(my $files, '-|', qw(git ls-files));
> while (<$files>) {
> chomp;
> ...
> }
>
> make sense? Or a simpler but non-streaming spelling:
>
> my @files = map { chomp; $_ } `git ls-files`;As a minor sidenote you can equivalently write that as:
chomp(my @files = `git ls-files`);
I.e. chomp itself when given a list will chomp each item of the list. So no need for a map.