develooper Front page | perl.perl5.porters | Postings from January 2022

Re: Pre-RFC: command-line flag for slurping

Thread Previous | Thread Next
From:
Paul "LeoNerd" Evans
Date:
January 28, 2022 15:25
Subject:
Re: Pre-RFC: command-line flag for slurping
Message ID:
20220128152451.08c2ca8e@shy.leonerd.org.uk
On Wed, 29 Sep 2021 17:00:15 +0200
Tomasz Konojacki <me@xenu.pl> wrote:

> "-0777" flag is the usual way to read the whole file at once (instead
> of line by line) in one-liners.
> 
> I feel this isn't ideal. "-0" is a bad flag. It's overly general,
> users rarely need $/ to be set to anything other than undef or "\n".
> Also, the input record separator has to be specified as an octal
> number, which is weird. The fact that the numbers above 0o377 are
> special-cased to mean "undef" makes it even more confusing.
> 
> Slurping is an extremely common operation and it deserves its own
> one-letter flag. I propse "-g" (mnemonics: gobble, grab, gulp). I wish
> it could be "-s", but sadly it's already taken :(

This RFC is now accepted as RFC 0011

  https://github.com/Perl/RFCs/blob/master/rfcs/rfc0011.md

We eagerly await an implementation.

-- 
Paul "LeoNerd" Evans

leonerd@leonerd.org.uk      |  https://metacpan.org/author/PEVANS
http://www.leonerd.org.uk/  |  https://www.tindie.com/stores/leonerd/

Thread Previous | 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