develooper Front page | perl.perl5.porters | Postings from October 2021

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

Thread Previous
From:
Oodler 577 via perl5-porters
Date:
October 19, 2021 19:37
Subject:
Re: Pre-RFC: command-line flag for slurping
Message ID:
YW8eZdeMhX/kLVM5@odin.sdf-eu.org
* Joseph Brenner <doomvox@gmail.com> [2021-10-19 12:25:48 -0700]:

> Oodler 577 via perl5-porters <perl5-porters@perl.org> wrote:
> 
> >If it's going to be equivalent to "-0777", which directly impacts the record
> separator, then "-R" is probably better.
> 
> I thought we could do better than that, but maybe not... of the
> available choices -R isn't bad.  The remaining unused single ascii
> letters are:
> 
>     b g j k o q r y z A B G H J K L N O P Q R Y Z
> 
> Though there are some numerics also:
> 
>    -1  do it in one gulp (confusable with -l, though)
> 
> Possibly:
> 
>   -o  do it in "one" gulp (myself I'd keep it in case there's a need
> for "output")
> 
> Maybe:
> 
>    -N  the "opposite" of -n
>    -P  the "opposite" of -p
> 
> so instead of, say, -nR or -pR you could just use -N or -P

FYI ~

In awk, "RS" is the the "record separator" (like Perl's $/); so
any combination of "[rR][sS]" might do - I understand we're working
with just single character options, so the "r" and the "s" would
be defined such that the combination "RS" does the right thing - I'm
not sure if that's possible but if it is, this wwould be the most
historically relevant approach.

That said, Perl reappropriates a lot of stuff from awk, e.g., "BEGIN"
and "END".

Thanks for the comment.

Cheers,
Brett

-- 
--
oodler@cpan.org
oodler577@sdf-eu.org
SDF-EU Public Access UNIX System - http://sdfeu.org
irc.perl.org #openmp #pdl #native

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