On 2020-05-05 William Michels via perl6-users
wrote:
> If the only difference between the "-n" and "-p" flags is really that
> the second one autoprints $_, I would have expected the "-pe" code
> above to work identically to the "-ne" case (except "-ne" requires a
> print, put or say). Presumably
In:
perl6 -ne 'put .chop' demo1.txt
the script prints out the value returned by the chop method, because put
acts on this value.
In:
perl6 -pe '.chop' demo1.txt
the value returned by chop is discarded and the script print $_ unaltered.
Cheers,
Laurent.
Le mar. 5 mai 2020 à 21:07, William Michel
Oops my example was missing the important $*USAGE message. And it makes
sense to show the wrong named args before the wrong list args.
example.raku:
multi sub MAIN(:$these ="These", :$are="Are") { say "$these $are"; };
multi sub MAIN(*@wrong-list,:$these ="These", :$are="Are",*%wrong-named)
is
Here's something to play with (without explanation from me, busy enough
sorry!)
example.raku:
multi sub MAIN(:$these ="These", :$are="Are") { say "$these $are"; };
multi sub MAIN(*@wrong-list,:$these ="These", :$are="Are",*%wrong-named)
is hidden-from-USAGE
{say "Got bad args " ~ @wrong-l
On Tue, May 5, 2020 at 8:01 AM Gianni Ceccarelli wrote:
>
> On 2020-05-05 William Michels via perl6-users
> wrote:
> > mbook:~ homedir$ perl6 -ne 'put .chop' demo1.txt
> > this is a test
> > I love Unix
> > I like Linux too
> > mbook:~ homedir$ perl6 -pe '.chop' demo1.txt
> > this is a test,
> >
On Tue, 5 May 2020, 06:46 ToddAndMargo via perl6-users,
mailto:perl6-us...@perl.org>> wrote:
Hi All,
Just to prove I read the stinker:
https://docs.raku.org/routine/MAIN
I am trying to get the following to do
#!/usr/bin/env perl6
sub MAIN(:$these ="These", :$are="Are")
On 2020-05-05 William Michels via perl6-users
wrote:
> mbook:~ homedir$ perl6 -ne 'put .chop' demo1.txt
> this is a test
> I love Unix
> I like Linux too
> mbook:~ homedir$ perl6 -pe '.chop' demo1.txt
> this is a test,
> I love Unix,
> I like Linux too,
The ``.chop`` method does not mutate its ar
Hi, I was trying to write raku/perl6 version of the sed code listed in
this article:
"How to sed remove last character from each line"
https://www.cyberciti.biz/faq/sed-remove-last-character-from-each-line/
What I came up with was two one-liners. But the first one-liner using
the "-ne" flag works
I would suggest starting by reading this page in the docs :
https://docs.raku.org/language/create-cli
Covers how $*USAGE is created and the various options you have for
providing help data.
On Tue, 5 May 2020, 06:46 ToddAndMargo via perl6-users, <
perl6-us...@perl.org> wrote:
> Hi All,
>
> Just