Re: LogP6 not working as I expect

2019-05-10 Thread Patrick Spek via perl6-users
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

Aha!

That works for me!

I don't particularly need it to be a constant, I just used constants
before to make sigil-less variables. I generally don't use `my \foo`
because I don't like how instantiation and use differ (one uses the `\`
sigil, which is no longer afterwards).

But it works for this particular instance, and is also used in their
own documentation. I didn't know the `constant` would differ in a way
like this.

Thanks for the help!

On Fri, 10 May 2019 15:32:58 +0200
Timo Paulssen  wrote:

> Hi Patrick,
> 
> It could be that compile time is too early for the logger object to
> properly be set up; try to see if "my \Log" instead of "constant Log"
> fixes it, then we can perhaps find a better solution that still has
> "constant" (for example a feature request for LogP6)
> 
> Kind Regards
>   - Timo



- -- 
With kind regards,

Patrick Spek


www:  https://www.tyil.nl/
mail: p.s...@tyil.nl
pgp:  1660 F6A2 DFA7 5347 322A  4DC0 7A6A C285 E2D9 8827

social: https://pleroma.tyil.nl/tyil
git:https://git.tyil.nl/

-BEGIN PGP SIGNATURE-

iQEzBAEBCgAdFiEEtvaXdC78r18jzlHVAx1lkC6ECCEFAlzWITkACgkQAx1lkC6E
CCGsdAgAk+P4nx63uSYLw4mGMYK2OvnkfGW0WD1VoKHkxjFFaK0VdQepsF26z32B
kD8uRKKcxlh/8zBXw2oJdtb5ZgrOFTo/c4Hq3tKDXcAsev5rkH6eOmhnv+qvpGU0
nEO0YIO2PeyazLNlldwEKJa7VCoG/mGqQA3wcwm0LLbZI/XmS7cloxlBvj5vsClB
SsCcVcJ0EfdWDViLRcWXQkNYu6g67FTaYuVlaYdAnyPhpppA2IQNWr35USuen/2h
78SBfSlCtg6l188o7y2NgncitXTsS9vxSzxTBAVafx9x9Y1vN3pvuZufOwI+17Gr
EoAhT40Ko+37wmi6zthq4uOb8om41A==
=XnBV
-END PGP SIGNATURE-


LogP6 not working as I expect

2019-05-10 Thread Patrick Spek via perl6-users
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

Hi all,

I'm trying to use LogP6 in one of my projects, but it's not working the
way I was expecting it to work. Presumably I'm overlooking something
simple, but I can't seem to figure out what or why. I have the
following code:


use App::CPAN::Repositories::Migration;
use Terminal::ANSIColor;
use LogP6 :configure;

unit module App::CPAN::Bin::Migrate;

filter(:name(''), :level($trace), :update);

constant Log = $?MODULE.^name.
constant MigrationRepo = App::CPAN::Repositories::Migration;

#| Undo the latest migration
multi sub MAIN (
  Bool:D :$down!
) is export {
  CATCH {
when .message ~~ / "relation \"_migrations\" does not exist" / {
  $?MODULE.^name.("why have you forsaken me");
  dd Log;
  Log.warn("No migrations left to undo");
  exit 1
}
  }

  my $last = MigrationRepo::last();

  MigrationRepo::down($last);

  say "Ran downgrade migration {color("bold")}{$last}{color("reset")}";
}


When running the program, I see the output "why have you forsaken me",
but not the output "No migrations left to undo". I added the `dd` call
to ensure that the `Log` constant is available, which it is. Why is the
log call of `Log.warn()` not being shown, but the
`$?MODULE.^name.()` is?

- -- 
With kind regards,

Patrick Spek


www:  https://www.tyil.nl/
mail: p.s...@tyil.nl
pgp:  1660 F6A2 DFA7 5347 322A  4DC0 7A6A C285 E2D9 8827

social: https://pleroma.tyil.nl/tyil
git:https://git.tyil.nl/

-BEGIN PGP SIGNATURE-

iQEzBAEBCgAdFiEEtvaXdC78r18jzlHVAx1lkC6ECCEFAlzVKVEACgkQAx1lkC6E
CCGPbAf/ZirLlQvfS7bncgVdJ4tFKvtXVbPFMfCFRZqUQ5Zj48EnMR51K26hjDwy
5BJhXB8HNzAuwzf7jjqbyYiOkkq4vHhWcsDfhdQ2zdgtapApaCFliGoUbDKAQQRR
1iTXXlxY3P4JmBuTXw+uenFcI7eBhhNTn0SRfFtpqqEdtBKO3Oc3Ff9HQP1OTBoJ
QxTWCh/okYYnR8y+G4Od9aVNOpPOSChiEoeQ9ZjLNlT9ZjeoQSH5FPW/AbsFhqyM
zFp+7U5gWf0qy/3m4uKiKnIns3zz5ydGoZgA4P5mWAqDPGMfsqq2TRnlDm6mDu5A
qGn/ww/eC6kFK7sfn8sHxLZBiueobg==
=WLEV
-END PGP SIGNATURE-


Re: filever.exe sub?

2019-01-30 Thread Patrick Spek via perl6-users
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

A quick search yields me the program `pev`:
http://pev.sourceforge.net/doc/manual/en_us/

Maybe this can help you out. If it performs the tasks you need it to
perform, you could browse the source code and rewrite it into a Perl 6
project :)

On Tue, 29 Jan 2019 21:57:28 -0800
ToddAndMargo via perl6-users  wrote:

> On 1/29/19 9:53 PM, ToddAndMargo via perl6-users wrote:
> > Hi All,
> > 
> > Windows provides a utility called filever.exe which will
> > tell you the revision of and exe file.  (You can also see this
> > through the gui with properties).
> > 
> > Currently I run filever.exe through Wine.  It is cumbersome,
> > especially since Wine floods STDERR.  I work around it.
> > 
> > Do we have a module for the file's version?  If so, does
> > it run in Linux?
> > 
> > If not, does anyone know where the version information is
> > stored in and .exe file so I can write one myself?
> > 
> > Many thanks,
> > -T  
> 
> Sorry.  I keep using "and" instead of "an".  Stinkin' typos.

-BEGIN PGP SIGNATURE-

iQEzBAEBCgAdFiEEtvaXdC78r18jzlHVAx1lkC6ECCEFAlxRuQMACgkQAx1lkC6E
CCFC0gf/T4if9Gt3YUcTLWDobaWlvo6ewwsxcXJQlD7u8O46ImcAlVSyJRBjAkkN
5Lbatc/UleyzIk3qJmWSCgJyzEV0ZgakdcBAtumB9mrxZrg0cPWBNblDDo+pnSJA
qjpkB690KqlUNuZmBhfp/Xh6E2wWi7PhoDWlYtrJ/1j+AF8iGonuV1/93cXXw1fO
MCs+S9Rn41hb4SqTJShaELLxzR39UmdE3/f0istOFOq3bsaE/WOxxJ4ovccuIEJw
/xdS7tOLHMQoTSQTH/xjx7BdyUmCTfspsEmqqfoh2NgD+IOuo4lt3Ns3INPFfNfO
4EwZc2IgWaFrJPe1lf2Hmag/0pPoyg==
=TCki
-END PGP SIGNATURE-


Re: Perl6 use cases

2018-11-04 Thread Patrick Spek via perl6-users
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

Hi,

I've been using Perl 6 in my personal projects to create an IRC bot
(using IRC::Client), a number of modules, and currently trying to set
up a new mail environment with a management API built with Cro.

At work, I've used Perl 6 to deal with DMARC notifications from Google.

In my experience, it allows me to write out my thoughts to working code
with very little effort, and still keep it readable.

On Sun, 04 Nov 2018 23:18:53 -0500
N6ghost  wrote:

> Hi all,
> 
> Been looking around trying to find, anyone who is actually using
> Perl6. and what they are using it for.
> 
> and if they are, what are there thoughts on it?
> 
> Thanks
> 
> -N6Ghost



- -- 
With kind regards,

Patrick Spek


www:  https://www.tyil.work/
mail: p.s...@tyil.nl
pgp:  EB9E A484 1672 2D37 16F5  A799 9ACF E193 FFBC 1F50

mastodon: @tyil@mastodon.social
github:   @Tyil
gitlab:   @tyil

-BEGIN PGP SIGNATURE-

iQEzBAEBCgAdFiEEtvaXdC78r18jzlHVAx1lkC6ECCEFAlvf6XsACgkQAx1lkC6E
CCGPCgf/QZRciqw4HCLVEpqAeKVVk66Z2+qZS01uKZsWYgHggKo32NU2wy24Ef9y
eQbH81W7pLmtVFOybNH82XNHIj8kg4nGZDgqsM9Jlccsv5mh5Gea5x4MPUiaVP2X
jgDnaK5ZsgSm/2ThNJ+1QboFHyrcLYNq6oT8b/tgeOWfXt0I10BxCfK8+8HKSj7w
Y6urFks/L5bqsoNbNS6UDKZI/qUbR8gGeB3ArjFN04n464uwg/Wc4fUXTZR8hEkG
YDcsCkQx5Uyc4aRPVUFa61KaHIU1BvfWirW2+leaYIgkzBcjw4pyd6Nq2bZ2dFfC
qiDsrFZ2Vk/5/KKNIGyDs0bAG9Hbtg==
=+huv
-END PGP SIGNATURE-


Re: Installing Perl6 on shared server

2018-09-26 Thread Patrick Spek via perl6-users
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

On Wed, 26 Sep 2018 11:20:49 +0800
Richard Hainsworth  wrote:

> a) Is there a rakudo package for debian Stretch I can install? (I'm
> just asking, but I doubt it).

https://github.com/nxadm/rakudo-pkg/releases

I believe Stretch is Debian 9, so you would want to try out
https://github.com/nxadm/rakudo-pkg/releases/download/v2018.09/rakudo-pkg-Debian9_2018.09-01_amd64.deb
as the deb of your choice. You should be able to install it with `dpkg
- -i`, however, I believe it requires root powers in order to do so.

If you have Docker as an option, there's the `rakudo-star` image
available as well.

When all else fails, remember that a VPS nowadays ranges from 1 to 10
euro a month, and then you get root access to the machine. This might
be the least effort to get you going.

- -- 
With kind regards,

Patrick Spek


www:  https://www.tyil.work/
mail: p.s...@tyil.nl
pgp:  EB9E A484 1672 2D37 16F5  A799 9ACF E193 FFBC 1F50

mastodon: @tyil@mastodon.social
github:   @Tyil
gitlab:   @tyil

-BEGIN PGP SIGNATURE-

iQEzBAEBCgAdFiEEtvaXdC78r18jzlHVAx1lkC6ECCEFAlurKggACgkQAx1lkC6E
CCEYFggAoFaCJVhHTNRQWH0vZ4Dr47RSIqkS8hwGBguoOQSxdNtAYDhEj3Nn+Or9
5IisdNMW2EGfRniD7AR6szlFv3Ti+J0+GL473CIgPlYlx98WTATDxsDpn6FKoOWu
vG9BGVN9mnBE5w7d82k9rRJBe7g9XlUoWEgKoFYQ3MI5y3cL1HX9x42+WBxGbfgq
/4lAlVmMhyC28lFhr5Bb0hQbo3VG7XVcZnF0yrFm40hhGyUR1Ql/jv3qn5B8qBxm
U7B0itZUeJfsRacUBHyUWdmHqONLqU16mcGus4mQRLfSbmWkQJGWvK5Vh3CY93L4
9ZO+UTKkjGMzUmBtJzengKis3WiTZw==
=bHzt
-END PGP SIGNATURE-


Re: A grammar to provide substitution

2018-08-29 Thread Patrick Spek via perl6-users
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

It's supposed to be simple, since I don't need much. The most basic of
substitution is all I care about right now. I've implemented it with a
simple regex now, and it seems to work just fine. It's available as a
module[1] now, and it's used in another module of mine[2]. If anybody
wants to improve it, feel free to submit a MR on the repository[3].

Thanks everyone for your help!

[1]: https://modules.perl6.org/dist/I18n::Simple:cpan:TYIL
[2]: https://gitlab.com/tyil/perl6-app-assixt
[3]: https://gitlab.com/tyil/perl6-i18n-Simple

On Wed, 29 Aug 2018 19:28:56 +0200
Timo Paulssen  wrote:

> I should point out that the trans method has a mode that lets you pass
> placeholders and substitutions and it will Do The Right Thing
> regarding overlaps and order and everything.
> 
> 
> On 29/08/18 16:21, Timo Paulssen wrote:
> > There's a problem with your code, if any of the substitutions
> > contains something that looks like the placeholder thing, and if it
> > comes later in the iteration of the hash keys (which is randomized
> > now) it will substitute again. This is very likely not what you
> > want, though.
> >
> > HTH
> >   - Timo
> >
> > On 28/08/18 20:04, Laurent Rosenfeld via perl6-users wrote:  
> > > Hi Patrick, > > for note that this codeline: > > my Str $input =
> > > "Here be a  
> > $(placeholder), for $(purpose) purposes."; > > will not compile
> > because Perl will try to interpolate $(placeholder) and $(purpose)
> > as vairables that have not been declared. > > You need to use non
> > interpolating quotes: > > my Str $input = 'Here be a $(placeholder),
> > for $(purpose) purposes.'; > > Then, I would probably use simple
> > substitutions, as with this example: > > my Str $input = 'Here be a
> > $(placeholder), for $(purpose) purposes.'; > > sub format-string
> > ($input, %substitutions) { > my $str = $input; > for keys
> > %substitutions -> $key { > $str ~~ s/$key/%substitutions{$key}/;
> > > } > return $str; > } > my %substitutes = '$(placeholder)' =>
> > "placeholder", '$(purpose)' => "testing"; > my $output =
> > format-string($input, %substitutes); > say $output; > > This is the
> > output running this under the REPL: > > > my Str $input = 'Here be a
> > $(placeholder), for $(purpose) purposes.'; > Here be a
> > $(placeholder), for $(purpose) purposes. > > > > sub format-string
> > ($input, %substitutions) { > * my $str = $input; > * for keys
> > %substitutions -> $key { > * $str ~~ s/$key/%substitutions{$key}/;
> > > * } > * return $str; > * } > sub format-string ($input,
> > > %substitutions) {
> > #`(Sub|214745424) ... } > > my %substitutes = '$(placeholder)' =>
> > "placeholder", '$(purpose)' => "testing"; > {$(placeholder) =>
> > placeholder, $(purpose) => testing} > > my $output =
> > format-string($input, %substitutes); > Here be a placeholder, for
> > testing purposes. > > say $output; > Here be a placeholder, for
> > testing purposes. > > I hope this helps. > > Cheers, > Laurent. > >
> > >  
> > > > Le mar. 28 août 2018 à 12:25, Patrick Spek via perl6-users  
> > mailto:perl6-users@perl.org>> a écrit : >  
> >> Hi all,
> >>
> >> I'm trying to substitute parts of a string, and thought this might
> >> be a good use of a grammar. Sadly, grammars aren't my strong suit,
> >> so I thought I'd ask the wider community for help. Maybe you guys
> >> know an even better solution than using a grammar here.
> >>
> >> So, consider a string, "Here be a $(placeholder), for $(purpose)
> >> purposes.". I want to be able to put that into a sub, along with
> >> some Pairs, and get a string with the placeholders replaced back.
> >>
> >>     my Str $input = "Here be a $(placeholder), for $(purpose)
> >> purposes."; my Str $output = format-string(
> >>     $input,
> >>     placeholder => "placeholder",
> >>     purpose => "testing",
> >>     );
> >>
> >>     dd $output; # "Here be a placeholder, for testing purposes."
> >>
> >> The `format-string` sub would call the grammar and apply the actual
> >> substitution, and that's where I need your help. I am not quite
> >> sure how I would implement the grammar (and presumably it's
> >> actions) to do what I want.
> >>
> >> Thanks in advance for your help!
> >>
> > >  
> >  
> 



- -- 
With kind regards,

Patrick Spek


www:  https://www.tyil.work/
mail: p.s...@tyil.nl
pgp:  EB9E A484 1672 2D37 16F5  A799 9ACF E193 FFBC 1F50

mastodon: @tyil@mastodon.social
github:   @Tyil
gitlab:   @tyil

-BEGIN PGP SIGNATURE-

iQEzBAEBCAAdFiEE4eL662U9iK2ST2MqN/W6H45XOE8FAluHBKQACgkQN/W6H45X
OE8I/wf/YWLWKCxj0AUvJt9xaosRPYYw2A3z8IgejA95S6UjeIgCzswal3xp0YiU
FfkUL0eSiuXc2fw3FLFl/FK0R6KzpW8V+kBpKZaB0bcU9tErpwTYwLQFyxvdgYjQ
FUiCZ+sM6963RihCJZwVMF8pzwZDOcKMmuxg67Ufd/syOHE7yZT2MV8FxXAA0xAT
pGRA00XrlSIzJTY1VQcWY5JjrbM+aD9U/QsfWiVc8oKrbAKGExJ096UQ3bcDhFzf
EwMhdGBUrkQjfGj7TPWhC9w2fmth+DiNx2EhSYZCKs7Qn0+XmaOMsznC6/Dm23sv
ok27sdgL+jr/P0x1CjrpAlxX5jgJiA==
=fDhH
-END PGP SIGNATURE-


A grammar to provide substitution

2018-08-28 Thread Patrick Spek via perl6-users
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Hi all,

I'm trying to substitute parts of a string, and thought this might be a
good use of a grammar. Sadly, grammars aren't my strong suit, so I
thought I'd ask the wider community for help. Maybe you guys know an
even better solution than using a grammar here.

So, consider a string, "Here be a $(placeholder), for $(purpose)
purposes.". I want to be able to put that into a sub, along with some
Pairs, and get a string with the placeholders replaced back.

my Str $input = "Here be a $(placeholder), for $(purpose) purposes.";
my Str $output = format-string(
$input,
placeholder => "placeholder",
purpose => "testing",
);

dd $output; # "Here be a placeholder, for testing purposes."

The `format-string` sub would call the grammar and apply the actual
substitution, and that's where I need your help. I am not quite sure
how I would implement the grammar (and presumably it's actions) to do
what I want.

Thanks in advance for your help!

- -- 
With kind regards,

Patrick Spek


www:  https://www.tyil.work/
mail: p.s...@tyil.nl
pgp:  EB9E A484 1672 2D37 16F5  A799 9ACF E193 FFBC 1F50

mastodon: @tyil@mastodon.social
github:   @Tyil
gitlab:   @tyil

-BEGIN PGP SIGNATURE-

iQEzBAEBCAAdFiEE4eL662U9iK2ST2MqN/W6H45XOE8FAluFIw0ACgkQN/W6H45X
OE+9pAgAry3KwoOS+A5g+y9V0hPHx24nQ6U8TcbZh/HIuvwwbinkCi4oxfhGwTBX
FXeogYj18OF+K7KEq45fAtB7sqrAelo59elu+ZCXZmiFH1BNHFNWbINkKKWQdHAs
uYTL7poMwSQ+XQVBTCu3dY32jVl3qasSr4dAM0g6za8TTtgw0TTblF/aNO6A0KC6
cf757hWxZ7VqprIbpPfvQnB/0BreVu467Va7EGdzZDwi3WfQTg9R0H1NTSkpdS0M
fyhMJ21rjBhhiUZt+DOHThcd5s7ikk1d1fX5x/hEgRNIcmbQVZ7N3STGSxtqFm6h
thQ2zhTXGgE/VrTaOHP0a8NiqPamEQ==
=RlqT
-END PGP SIGNATURE-


Re: start up delay?

2018-08-06 Thread Patrick Spek via perl6-users
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

If you're writing a runnable script in Perl 6, I would recommend to
*always* use a MAIN sub[1]. If you're using that, you can easily
achieve the precompilation as well, with 1 line of code less.

You'd have your code in lib/Your/Program/Main.pm6:

sub MAIN (
# You can let Perl 6 handle arguments here
) is export {
# Program code here
}

Next, the script that you actually run would be in bin/program, and
contain the following code:

use lib "./";
use Your::Program::Main;

This should give you all of the Perl 6 MAIN goodness, and a faster
program.

[1]: https://docs.perl6.org/language/functions#index-entry-MAIN

On Mon, 6 Aug 2018 10:56:43 +0100
Simon Proctor  wrote:

> So Perl6 is a lot like Python in that modules get compiled to byte
> code making them a lot faster to parse the second time around.
> 
> If you're running a 6000 line script then a lot of time is going to be
> spent parsing your script every time you run it. If you instead take
> all your script code and pop it into a module and have a script along
> the lines of :
> 
> use lib "./";
> use System;
> 
> System::start();
> 
> (Where your module code is called System.pm6 and start is the entry
> point subroutine).
> 
> I think you'd find this improves the speed of the script
> significantly.
> 
> On Mon, 6 Aug 2018 at 10:38 ToddAndMargo 
> wrote:
> 
> > On 08/06/2018 02:07 AM, ToddAndMargo wrote:  
> > > On 08/06/2018 01:02 AM, Simon Proctor wrote:  
> > >> Sorry I wrote my earlier email on my phone without a computer to
> > >> hand. Here's a quick rundown on what I'm talking about.
> > >>
> > >> --stagestats gives you the breakdown on how much time is spent
> > >> doing various steps (note that using time instead of date; date
> > >> gives you a better timing of how long something took.
> > >>
> > >> time perl6 --stagestats -e ""
> > >> Stage start  :   0.000
> > >> Stage parse  :   0.089
> > >> Stage syntaxcheck:   0.000
> > >> Stage ast:   0.000
> > >> Stage optimize   :   0.001
> > >> Stage mast   :   0.004
> > >> Stage mbc:   0.000
> > >> Stage moar   :   0.000
> > >>
> > >> real0m0.144s
> > >> user0m0.155s
> > >> sys0m0.032s
> > >>
> > >> And generally that's going to be the case for most short
> > >> programs, in these cases especially moving to having the core of
> > >> your code in modules with give you a speed boost.
> > >>
> > >> Sorry if my comments earlier were unhelpful.
> > >>
> > >> Simon
> > >>
> > >> On Mon, 6 Aug 2018 at 08:56 ToddAndMargo  > >> > wrote:
> > >>  
> > >>  >> On Sun, 5 Aug 2018, 23:45 Elizabeth Mattijsen,
> > >>  >>  > >>   
> > >>  >> >> wrote:
> > >>  >>  
> > >>  >>  > On 1 Aug 2018, at 20:14, ToddAndMargo  
> > >> mailto:toddandma...@zoho.com>  
> > >>  >>  > >> >> wrote:  
> > >>  >>  > Is it just me or does Perl 6 take about three
> > >>  >>  > times as  
> > >> long to  
> > >>  >>  > start up as Perl 5?  I do have a very fast
> > >>  >>  > machine and it  
> > >> takes  
> > >>  >>  > about seven see for some of my Perl 6 stuff to
> > >>  >>  > get past  
> > >> the  
> > >>  >>  > ruminating phase and start running.  
> > >>  >>
> > >>  >> Seven seconds?  Seven?  That seems *very* long
> > >>  >> indeed.
> > >>  >>
> > >>  >> How long does it take to do:
> > >>  >>
> > >>  >> perl6 -e ‘’
> > >>  >>
> > >>  >> ?  That should be in the order of 130 msecs.  If
> > >>  >> that’s the  
> > >> case,  
> > >>  >> then you’re probably doing a lot of grammar changes
> > >>  >> to Perl  
> > >> 6.  But  
> > >>  >> without the actual code, this remains guessing.
> > >>  >>
> > >>  >>  
> > >>  >>  > Any workaround for this, or is this just growing
> > >>  >>  > pains  
> > >> for Perl 6?  
> > >>  >>
> > >>  >> Not sure  :-)
> > >>  >>
> > >>  >>
> > >>  >>
> > >>  >> Liz
> > >>  >>
> > >>  >> --
> > >>  >> Simon Proctor
> > >>  >> Cognoscite aliquid novum cotidie  
> > >>
> > >> On 08/05/2018 10:57 PM, Simon Proctor wrote:  
> > >>  > Have you tried running with --stagestats which gives you
> > >>  > a break  
> > >> down of  
> > >>  > where the time is being spent?
> > >>  >
> > >>  > On thing is if you are running large script files it came
> > >>  > take a  
> > >> while.  
> > >>  > Moving your code into modules, which get precompiled can
> > >>  > give a significant speed boost.  
> > >>
> > >> Does this tell you anything?
> > >>
> > >> $ curl --fail --head https://google.com; echo $?
> > >> 

Re: return code?

2018-07-29 Thread Patrick Spek via perl6-users
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

I'd gladly help you get your first module published.

First off, you'll need to have a META6.json describing which files your
module will provide, and which dependencies it needs. You always will
need this json file, even if you have no dependencies.

Additionally, you will probably want to move the module files into a
lib/ subdirectory, as this is the standard for Perl 6 modules to live
in.

Your README.md could use a little extending as well, with information
on what problems it solves, how people can install it, but most
importantly, some examples on how people can use it. Many people also
add their license information in the README file, which I'd recommend
as well.

On the matter of licensing, your module currently is not licensed,
which means in most legal jurisdictions that it is not freely usable. I
am not a lawyer, though, so I may be completely wrong. I'd still
recommend you use a free software license to clear out any doubt, so
people know what they can and cannot do. I'm a personal proponent of
the GNU General Public License, but you should check out
ChooseALicense[1]. This site can help you pick a suitable license for
your code.

For some shameless self promotion, I have a module that can help you in
creating new modules: Assixt[2]. You can install it with zef:

zef install App::Assixt

Once installed, you can create a new module skeleton directory using

assixt new

It will ask you a couple questions, which it will use to create a
correct META6.json file for you. If you're planning on making more
modules, you can configure some default values for a number of these
questions with

assixt bootstrap config

Once you've created the new module skeleton, change to the new
directory and add the files you want to have added:

assixt touch class Command
assixt touch class Command::Result
cp ../old-dir/Command.pm6 lib/Command.pm6
cp ../old-dir/Command/Result.pm6 lib/Command/Result.pm6

The assixt calls will generate skeleton class files, and update the
META6.json to reflect these new files. But, since you already have the
actual files, you can just cp them into the new directory to take the
place of the generated skeleton files.

Once you've done this, make sure everything still works. I would
recommend adding some tests[3] as well. You can generate empty test
files in the right directory with

assixt touch test 

Assixt will have made a default Travis[4] configuration as well, so you
can enable automated testing on each commit that you push to Github. I
personally prefer GitLab, so there's also a GitLab-CI configuration
available by default. The GitLab-CI tests run *much* quicker, as there
is no need to install Perl 6 as a seperate action.

So, to reiterate, you should:

- - Put your files into the right locations
- - Have a META6.json
- - Add a license
- - Add some tests (and actually run them!)

Once all this is done, you're ready to publish your module. You can
either add them to the Perl 6 ecosystem repository[5], or upload them
to PAUSE[6]. Adding to the ecosystem repo is simply adding an entry
through a PR. I personally prefer PAUSE, which is what I'll cover here
for you.

You'll have to request a PAUSE account on their website[7]. This can
take a couple minutes up to a day or two before these requests get
processed. It looks more scary than it actually is, so just pick a
fancy username and mention that you want to contribute your Perl 6
modules to the community.

Once you have gained access to PAUSE, you can upload your module. The
easiest way to do this, is using Assixt again. When you're in the root
folder of your project, run the following:

assixt bump
assixt dist

The first command will "bump" up the version number. You can not
replace an existing version on PAUSE (and you shouldn't do it outside
PAUSE either), so you will have to increase the version number before
each release.

The second command will create a module distribution. This is just a
tarball that contains the files that other users will need to use your
module. Some files will be filtered out by Assixt, since they are
unneeded and would just bloat the distribution (such as
the .git, .gitignore and other such files). Assixt will also tell you
where it saved this distribution. You need to know where it was saved
to continue to uploading the distribution:

assixt upload 

Assixt will ask your username and password for PAUSE, and attempt to
upload it for you and store it in the right location. If your username
or password is incorrect, uploading will fail. You can just retry it in
that case.

If you're doing this more often, you can shorten the past three steps to

assixt push

This will basically run bump, dist and upload in one go. I prefer to
explain them all seperately so you know what's going on first. This
also helps you to understand that you can just rerun the upload command
if only that step failed on the push command.

If 

Re: return code?

2018-07-29 Thread Patrick Spek via perl6-users
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

I get the idea that you're trying to get a list of lines with the

@ReturnAry = split "\n", qqx ( curl $TimeOutStr -L $Url -o
$FileName; echo \$\? );

You can use the lines[1] sub for exactly this. Similarly for this line

for @ReturnAry[ 0 .. @ReturnAry.elems - 3 ]  -> $Line

You can use the head[2] sub to write it as

for @ReturnAry.head(*.elems - 3) -> $line

Also, on the

$ReturnStr += $Line

If you're trying to concatenate a string, you should use the ~ instead
of the +, so it'd become

$ReturnStr ~= $Line

[1]: https://docs.perl6.org/routine/lines
[2]: https://docs.perl6.org/routine/head

On Sat, 28 Jul 2018 23:46:30 -0700
ToddAndMargo  wrote:

> On 07/28/2018 01:37 AM, ToddAndMargo wrote:
> > Hi All,
> > 
> > How do I get the bash return code ("$?") from
> > the following?
> > 
> > $ReturnStr = qqx ( curl $TimeOutStr -L $Url -o $FileName ).lines;
> > 
> > 
> > Many thanks,
> > -T  
> 
> 
> Followup:
> 
> This is what I came up with:
> 
> if $ProgressBar {
># This need a space ofter the qqx
># $ p6 'my $x="cat /etc/hosts; echo \$\?"; my @y = split "\n", 
> qqx ( $x ); say @y[@y.elems-2];'
># 0
># 
> 
> 
>@ReturnAry = split "\n", qqx ( curl $TimeOutStr -L $Url -o 
> $FileName; echo \$\? );
>for @ReturnAry[ 0 .. @ReturnAry.elems - 3 ]  -> $Line { 
> $ReturnStr += $Line; }
>print "\n";
>$ReturnCode = @ReturnAry[ @ReturnAry.elems - 2 ];
> 
> } else {
>( $ReturnStr, $ReturnCode ) = RunNoShell ( "curl $TimeOutStr
> -L $Url -o $FileName" );
> }
> return ( $ReturnStr, $ReturnCode );

-BEGIN PGP SIGNATURE-

iQEzBAEBCAAdFiEE4eL662U9iK2ST2MqN/W6H45XOE8FAltdkOYACgkQN/W6H45X
OE+73gf+Ko8Wrm3aySxtsMsuVAWT+V4iNanSpEo8jj27+OUgQCmC1vY0yR7BkrJS
vb1WnM2TvzrxBlc/L9QF7dJaJfBkcB2Nera+PJWkdZlYegvmA9vKHbjyxl/Nvyi6
8M1GjtsmTKUFz3OT3T60fXYiRwiu2vG+OBeN4riWDI4HO9OiXw+kqcuUsymavNo3
6YdXXhwyfKLx+kdsIT1UAfSfWY+B53attz/XwTkiz8VH3cSP1zQtvx+zh5KbvA+i
CViRZQAvkeasQ77d70H9fd+oYhgJqHCF5/SSlB1MDP2Rn9YZDxhfDgsHuNEWjplm
7NTZDIMBn5JXLgSOkyulC+xIBG0sXg==
=Dk+C
-END PGP SIGNATURE-


Re: Bailador vs. Cro

2018-07-09 Thread Patrick Spek via perl6-users
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

I've only done some very basic stuff with both Cro and Bailador. From
what I can tell, Cro requires less code to get something going in, but
Bailador is easier to get a regular MVC model working in.

Have you read through the Cro SPA tutorial?
https://cro.services/docs/intro/spa-with-cro

It details setup for an API with a React+Redux frontend.

On Mon, 9 Jul 2018 03:01:34 +0200
mimosinnet  wrote:

> Hi all,
> 
> Appart from pure hobbyist pleasure, I use Perl for some personal web 
> development. I have (solely) used Mojolicious, really had fun, and 
> learned Perl using it. I have been for some time looking for a Perl6 
> framework for web development (Perl6 bewitched me), and Bailador
> looks like an attractive Perl6 starting point.
> 
> While trying to build an application with Bailador, I came across
> with Cro. While it looked quite complicated at the beginning, after
> watching Jonathan Worthington presentation [1] Cro looks quite
> versatile, close to new Perl6 features and very Promising ("anything
> can be put behind a Promise, but they can also be broken"). This
> weekend, I have been trying to build a simple web application with
> Cro [2], and it more or less worked out (and learned a lot of Perl6).
> 
> Before investing more time in this project, I wonder if you have any 
> advice or suggestions on Bailador, Cro (or another framework like
> Hiker [3]). Also, I would appreciate if you could point to some
> working examples (like [4]  or [5] ).
> 
> Many thanks! 
> 
> [1] https://www.youtube.com/watch?v=6CsBDnTUJ3A
> [2] https://github.com/mimosinnet/Cro-Personal-Web
> [3] https://github.com/tony-o/perl6-hiker
> [4] https://github.com/lancew/MyJudo
> [5] https://github.com/szabgab/Perl6-Maven
> 

-BEGIN PGP SIGNATURE-

iQEzBAEBCAAdFiEE4eL662U9iK2ST2MqN/W6H45XOE8FAltDRkYACgkQN/W6H45X
OE/plQf9H4WsdaYSnG44JFUBMWlPuS7RAjbeVmZw7SQ2nj7buBmDpQqteu7XdBY7
659myZLGQuBjC9c3yeQqWycdF3u9pAvyP9YNLWNlTGcwTv3ODfuxoHNCg+Xbf+zK
00xBsaebyvU32904w7I/CYueQIzVGxGhnuvtFKnisyIs2qy/EzxlSGNLk75yj4J0
R0nta5YD/cH5X66zbyvQ7grd4j7fh/VlhiGZx2z7VF/mLJxfTPIHUjflgSjNDioC
VoUXAfi++jPN6GnMFqkvmtdMZZMz39/H1w7HkqoSF15z2wH61a2wYrwoJvSBgc4c
xVDJ1oIg8vmt80f7DTcXzmUMkSk6pA==
=KSuY
-END PGP SIGNATURE-


Re: need help with zef error

2018-06-14 Thread Patrick Spek via perl6-users
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

I just tried this myself:

tyil@bast:~ » zef install IO::Socket::SSL
===> Searching for: IO::Socket::SSL
===> Updated cpan mirror: 
https://raw.githubusercontent.com/ugexe/Perl6-ecosystems/master/cpan.json
===> Updated p6c mirror: http://ecosystem-api.p6c.org/projects.json
===> Searching for missing dependencies: OpenSSL
===> Testing: OpenSSL:ver<0.1.19>:auth
# NETWORK_TESTING was not set
# NETWORK_TESTING was not set
===> Testing [OK] for OpenSSL:ver<0.1.19>:auth
===> Testing: IO::Socket::SSL:ver<0.0.1>:auth
# NETWORK_TESTING was not set
===> Testing [OK] for IO::Socket::SSL:ver<0.0.1>:auth
===> Installing: OpenSSL:ver<0.1.19>:auth
===> Installing: IO::Socket::SSL:ver<0.0.1>:auth

No problems detected. I do have a Perl 6 installed differently than
you, but that shouldn't be an issue on itself.

My `perl6 -v` output is

This is Rakudo Star version 2018.04.1 built on MoarVM version
2018.04.1 implementing Perl 6.c.

Can I ask you which distro you're using and what your `perl6 -v` output
is?

On Wed, 13 Jun 2018 23:40:31 -0700
Todd Chester  wrote:

> $ /opt/rakudo-pkg/bin/zef install IO::Socket::SSL
> ===> Searching for: IO::Socket::SSL
> ===> Searching for missing dependencies: OpenSSL
> ===> Fetching [FAIL]:
> IO::Socket::SSL:ver('0.0.1'):auth('github:sergot') from
> git://github.com/sergot/io-socket-ssl.git Aborting due to fetch
> failure: IO::Socket::SSL:ver('0.0.1'):auth('github:sergot')(use
> --force to override) in code  at 
> /home/todd/.perl6/sources/3192BD24F21B007D17D5398A1BEB41886A372215 
> (Zef::Client) line 205
>in method fetch at 
> /home/todd/.perl6/sources/3192BD24F21B007D17D5398A1BEB41886A372215 
> (Zef::Client) line 173
>in method fetch at 
> /home/todd/.perl6/sources/3192BD24F21B007D17D5398A1BEB41886A372215 
> (Zef::Client) line 161
>in sub MAIN at 
> /home/todd/.perl6/sources/16B60ECDC98BB269498FB2064857E4355FBF945D 
> (Zef::CLI) line 120
>in block  at 
> /home/todd/.perl6/resources/09C71DE0BF8C31A0E3291B1471D521114E17F384
> line 1 in sub MAIN at /opt/rakudo-pkg/bin/zef line 2
>in block  at /opt/rakudo-pkg/bin/zef line 2

-BEGIN PGP SIGNATURE-

iQEzBAEBCAAdFiEE4eL662U9iK2ST2MqN/W6H45XOE8FAlsiEA8ACgkQN/W6H45X
OE9wLgf/Wx9FCM+aPnesx5rzf5ThL2yJj2QBKzm5NZPj5AZNuhcFBLX7PVXNQJW5
iHG8VH3NVLqM8z+lxCljgBidzii6zyXAlmBkX1YZBez0ddpz6pSZSKp9ghB1mVR5
OU7760asVbKbO/5GmSnqTvhNI+AiPZvhLFkLZ00VSsjhcmecY05GxSYFN2/Ie1Q8
ZUSHrglCdKKJ/+t/5oYYwDYk4ATZ5fd5SIktkhQZCjG2Oa7LIKN5wn4H9VOobvt8
pnDceVAjRF0RdPoPyvz9UlK36IlQw0mDOjjoR4+d5PvBju/69+7urhwxncjh8KVC
DvW2YnZbosfMkjSwrZ3kDUpdWjzM+A==
=izqA
-END PGP SIGNATURE-


Re: How to print colorized text to the terminal

2018-06-03 Thread Patrick Spek via perl6-users
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

In proper Perl fashion, there's a module for this:
https://github.com/tadzik/Terminal-ANSIColor

I haven't used it myself, so I'm not sure how well it works, but it's
worth a shot at least.

On Sun, 3 Jun 2018 20:41:32 -0400
Xin Cheng  wrote:

> Hi,
> 
> I am trying to make a program to do grep with perl6 regular
> expression, and I would like to colorize the matched part to the
> terminal. So the following is what I wrote 
> 
> sub MAIN(Str $pattern,Str $filename){
> for $filename.IO.lines -> $line  {
> my Str $temp = $line;
> if $temp ~~ s/ (<$pattern>) /\\x1b\[31m$0\\x1b\[0m/ {say
> $temp}; # if no <> surrounding $pattern it becomes literal. }
> }
> 
> And I named the program as grep6, and I tried it in zsh as
> 
> > grep6 'M.*N' =grep6  
> 
> And I got,
> 
> sub \x1b[31mMAIN\x1b[0m(Str $pattern,Str $filename){
> 
> How do I turn the string into color?
> 
> Thanks!
> 
> Xin
-BEGIN PGP SIGNATURE-

iQEzBAEBCAAdFiEE4eL662U9iK2ST2MqN/W6H45XOE8FAlsUlAUACgkQN/W6H45X
OE99fAgAjm1X4aRFUcWcJM2pLnbxy69XxaG//1ZvGROm/+iO96s2/WlTFMf5httI
DJeJFQ5XTzGSwKQUn5PJXhMTCEqzcl8Niqtb/Armat8WCPgXW4DWjhlc9i+4nLiJ
mEv+TljWn1oEUEcC7jO4M60SfddXl9Uy+v5VUnl59NNcX3LwgGRYKQ9e3eDjyIGW
0aKL4KvDw3LvchxGJdc8BeNXvlvQLmyeousaP/xIWLNObphsRME3VDd4myL7dUxJ
bQreldZEFztz4ogTh7a/KnjHGZ46NyaY6LJZh1fa7cRvYNNkIMR8em5Js0/9dSAA
NCTm3why/Z6EBiWrWhPyBNNvRbiYaQ==
=EDFv
-END PGP SIGNATURE-


Re: need second pair of eyes

2018-06-03 Thread Patrick Spek via perl6-users
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

No problem!

To be precise, -e can be easily remembered from "evaluate" (which I
think is also what it actually stands for).

On Sun, 3 Jun 2018 16:08:04 -0700
ToddAndMargo  wrote:

> On 06/03/2018 03:57 PM, Patrick Spek via perl6-users wrote:
> > It's not that it particularly dislikes it, but you have to think
> > about it in what the options do, and what you want to accomplish.
> > 
> > In a regular Perl 6 script, you'd also have to consider the order in
> > which you do a similar thing. First, you need to make sure the
> > include paths are correct, so the module can be found. Then, you
> > have to `use` the module, so that you can access the subs and
> > classes it exports. Finally, you want to let it run some piece of
> > code that gets you where you want to go.
> > 
> > This is what -I, -M and -e do, respectively, when ran as a one-liner
> > from the shell.  
> 
> Makes total sense.  -e means go do something.
> 
> My goof up was my alias
> 
> $ alias p6
> alias p6='perl6 -e'
> 
> I had to write the thing out.
> 
> I mainly use one liners to test out syntax, especially
> regex's before stitching them into my programs.
> 
> And, now that I have your recommendations written down,
> I should not forget them again.
> 
> Thank you for the help!

-BEGIN PGP SIGNATURE-

iQEzBAEBCAAdFiEE4eL662U9iK2ST2MqN/W6H45XOE8FAlsUd+gACgkQN/W6H45X
OE/SaQf/Rvll52ckA+KRmpH6E0YHKarxDSQA6xeSnWHVpIh3r3FgQUvLX8FZEgcv
3mOsNNrglACC2+w9jO78zN/TCMFiInr0CAWyebgLLH0JbhLzyereZx6CtDfV17Qt
StsSAzAHK51DAFkqOwJILkZ0aMIk/ooqaXzeAU4SWP3oeBBg0DpzdWRDvh9/t1S7
UTX0AzMraR0P1cx8Y1h6lCyohHL1ynqjxNsq9Ut1OvTFXatwZZBoQpYEK/GkKQRn
AOWMNjiPv5PqPleAZrYQJv18toqbGAfRPHyt8wmMh79IXljPJZogohVheWUFa78R
UlugiKqSOJPVkJBsWrozuR+5CXbKXA==
=t7Ue
-END PGP SIGNATURE-


Re: need second pair of eyes

2018-06-03 Thread Patrick Spek via perl6-users
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

It's not that it particularly dislikes it, but you have to think about
it in what the options do, and what you want to accomplish.

In a regular Perl 6 script, you'd also have to consider the order in
which you do a similar thing. First, you need to make sure the include
paths are correct, so the module can be found. Then, you have to `use`
the module, so that you can access the subs and classes it exports.
Finally, you want to let it run some piece of code that gets you where
you want to go.

This is what -I, -M and -e do, respectively, when ran as a one-liner
from the shell.

On Sun, 3 Jun 2018 15:47:06 -0700
ToddAndMargo  wrote:

> >>   On Sun, 3 Jun 2018 15:22:17
> >> - -0700 ToddAndMargo  wrote:
> >>   
> >>> On 06/03/2018 03:06 PM, Brad Gilbert wrote:  
> >>>> It's -I. not -I  
> >>>
> >>> perl6 -I. -MRunNoShell '( my $a, my $b ) = RunNoShell("ls
> >>> \*.pm6"); say $a;' Could not open ( my $a, my $b ) =
> >>> RunNoShell("ls \*.pm6"); say $a;. Failed to stat file: no such
> >>> file or directory  
> 
> On 06/03/2018 03:39 PM, Patrick Spek via perl6-users wrote:
> > -BEGIN PGP SIGNED MESSAGE-
> > Hash: SHA256
> > 
> > You're missing `-e` here, it should be
> > 
> >  perl6 -I. -MRunNoShell -e '( my $a, my $b ) = RunNoShell("ls
> > \*.pm6");
> > 
> > For further clarification, the `.` after `-I` indicates the
> > directory that is being added to the paths Perl 6 checks for
> > libraries that are being used. Hence the `.` is needed to indicate
> > the current directory. I'm not sure if `-I` arguments get appended
> > or prepended to the list of paths.
> > 
> > The `-e` is for the expression that is to be run. Otherwise, it'll
> > try to open the argument as if it were a filename, which is why you
> > get the "no such file or directory" error.
> >   
> 
> Indeed!  Thank you!  I am putting this in my Keepers one liner file!
> 
> perl6 -I. -MRunNoShell -e '( my $a, my $b ) = RunNoShell("ls"); say
> $a;'
> 
> And it does not like the -e until after the I and the M

-BEGIN PGP SIGNATURE-

iQEzBAEBCAAdFiEE4eL662U9iK2ST2MqN/W6H45XOE8FAlsUcmUACgkQN/W6H45X
OE/imQf/dNAwMg2/ufFx+5lukuoNjDqEsHsmuOIfR8hk/UZANfC0FYTW5vD6wHXb
DFjwXzmSddAKn9FQkp3A0LuRb01RXn7Bd1i9aUI+a/1Q4djXRyD4TJDVhrE3OAXo
o4/T3DKnNQchcvyMjxog1fimPUZspC9jGz57FJUnA3Q3lKgS7HHsT+aUIs34lyC7
HiTtuWXrL1EFxGgww96ig6ce+/yaRT8oFzadGBcokmo+mP6b4oCufqmJYRXohjUh
oQxSRnduzgnHyIoxFeUFpIqZYK/8471wD4Eqz//QyBBOltQR8s2Bj2BaFDpnB2Gy
3XWRmdgCVJlKvkWH+dHumsWR9ZiaYw==
=/+hA
-END PGP SIGNATURE-


Re: need second pair of eyes

2018-06-03 Thread Patrick Spek via perl6-users
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

You're missing `-e` here, it should be

perl6 -I. -MRunNoShell -e '( my $a, my $b ) = RunNoShell("ls \*.pm6");

For further clarification, the `.` after `-I` indicates the directory
that is being added to the paths Perl 6 checks for libraries that are
being used. Hence the `.` is needed to indicate the current directory.
I'm not sure if `-I` arguments get appended or prepended to the list of
paths.

The `-e` is for the expression that is to be run. Otherwise, it'll try
to open the argument as if it were a filename, which is why you get the
"no such file or directory" error.

 On Sun, 3 Jun 2018 15:22:17
- -0700 ToddAndMargo  wrote:

> On 06/03/2018 03:06 PM, Brad Gilbert wrote:
> > It's -I. not -I  
> 
> perl6 -I. -MRunNoShell '( my $a, my $b ) = RunNoShell("ls \*.pm6");
> say $a;' Could not open ( my $a, my $b ) = RunNoShell("ls \*.pm6");
> say $a;. Failed to stat file: no such file or directory

-BEGIN PGP SIGNATURE-

iQEzBAEBCAAdFiEE4eL662U9iK2ST2MqN/W6H45XOE8FAlsUbgcACgkQN/W6H45X
OE8tcwf8DObCw9+ZDF2cNGfy8p4fc69HFS/FYjcfEGISFYZwi+s+xluQ7N1OTmKx
8Eiw0h5JFXh3CQTB2gFchjRzMjxhuXR1dqhPTUqak89s9919oiNcxQUvF5iJ61o+
SIB8xXDvqfrV6ogTX8fetqWPWL3MN2o0j6UewelCzh/TyG0etZ8b/QhJCZe3pYi7
FTHTMrgFjhb2bZhrP7qFchc/GzvhNedN9Gz5ppti8tdxDNSPLDQiHyTxCULi1Zqo
/afENk+qyGn6u3x03WFCdMMN7m0G5Xxcn8spvApbBwjWJYL8o183oxEFJkHyic8J
BwNwa7oMN1/ZovFHdhFsSh5s+8KcCQ==
=u8yi
-END PGP SIGNATURE-


Re: <> question

2018-06-03 Thread Patrick Spek via perl6-users
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

The < > syntax is a bit like qw<> from Perl 5. You'll get a List (or
Array, not sure which type exactly from it. So



is a list with two elements, "myfile1" and "myfile2". If you want to
use a variable, you can just provide it with one or more variables:

chmod 0o755, $myfile
chmod 0o755, ($myfile1, $myfile2)

On Sun, 3 Jun 2018 13:08:26 -0700
ToddAndMargo  wrote:

> On 06/03/2018 11:01 AM, Brandon Allbery wrote:
> > Is there something missing in the examples at the link?  
> 
> Well, a bit.  When I see
> 
>  chmod 0o755, ;
> 
> I think `myfile1` and `myfile2` are "functions", not
> data.
> 
> I instead look for something like
> 
>  chmod 0o755, < $myfile1   $myfile2 >;
> or  chmod 0o755, < "myfile1"  "myfile2" >;
> 
> And to make matter worse, the example does not work:
> 
> $ touch a b c
> $ p6 'chmod 0o777 < a b c >;'
> ===SORRY!=== Error while compiling -e
> Preceding context expects a term, but found infix > instead.
> at -e:1
> --> chmod 0o777 < a b c >⏏;  
> 
> 
> $ p6 'chmod 0o777 < "a" "b" "c" >;'
> ===SORRY!=== Error while compiling -e
> Two terms in a row
> at -e:1
> --> chmod 0o777 < "a"⏏ "b" "c" >;  
>  expecting any of:
>  infix
>  infix stopper
>  postfix
>  statement end
>  statement modifier
>  statement modifier loop
> 
> 
> $ p6 'chmod 0o777 < "a", "b", "c" >;'
> ===SORRY!=== Error while compiling -e
> Missing required term after infix
> at -e:1
> --> chmod 0o777 < "a", "b", "c" >⏏;  
>  expecting any of:
>  prefix
>  term

-BEGIN PGP SIGNATURE-

iQEzBAEBCAAdFiEE4eL662U9iK2ST2MqN/W6H45XOE8FAlsUTrcACgkQN/W6H45X
OE/ILwf/X7mElQ7bPzRBA3i7Vm4pi3E6/bUpf2SMz5LB3UhfVKHNSV5/fXGE1a/W
9oa5klItWioH5m+NF+3KeOyufxc1tDm+hN5I2iac8xNTkE4bHfna9tOK03xvQXLf
t3x/jMTW1YN0jsvOWJLCi4UgBOqs/1B5Z3HzV6X1XPXjU1qNphYRf8huRtg+lxBb
CQWFQgKljNzvNVqSWlG3J3XTTXdQZ69juW5LQC+a3C7y0/44jvas0eS/C3uGG48y
O7rDG75V6y8ZfWBzFSIiCycH0fOcnYxE64brsPiaP0limVgMyac4YU15ixrEocxK
Q83aFB+yIYVNSlfYl8Llw2ZofOlM9Q==
=SSBB
-END PGP SIGNATURE-


Re: Is there a built in recursive rmdir and mkdir?

2018-06-03 Thread Patrick Spek via perl6-users
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On Sun, 3 Jun 2018 13:13:31 -0700
ToddAndMargo  wrote:

> Does Perl 6 have a built in recursive rmdir
> equivalent to LINUX's `rmdir --parents path`?

For this, there's `rmtree` in the `File::Directory::Tree` module. It is
referenced in the docs: https://docs.perl6.org/routine/rmdir

> Also, does Perl6 have a built in recursive mkdir
> equivalent to LINUX's `mkdir --parents path`?

Also in the docs here: https://docs.perl6.org/routine/mkdir. This
behaviour you're looking for is the default behaviour of `mkdir` in
Pelr 6. To quote from the docs: 

> Also creates parent directories, as needed (similar to *nix utility
> mkdir with -p option); that is, mkdir "foo/bar/ber/meow" will create
> foo, foo/bar, and foo/bar/ber directories if they do not exist, as
> well as foo/bar/ber/meow.
-BEGIN PGP SIGNATURE-

iQEzBAEBCAAdFiEE4eL662U9iK2ST2MqN/W6H45XOE8FAlsUT2MACgkQN/W6H45X
OE9tPQf/RUGmdavSEDye4RIAbHpIkkikaIfj7dK0ym+63tsb/d1SceBtjK6AX6j8
5mu7/uNYAYWrbOKaxbLCk7lPbT3U20Ata9ntNKadi7irDAo8q9b7y/3GVi2avuQS
j9H2HAEtOfwjXhbBpvCo+Hq2XrTT8/wRyDyHFtm59Uqdx8njtpPwmEcDx/+GQj3r
d/ASoyTNo12CsL0sxTTpE8P93Gcj/lR7xRdmXAieVjSdz3HM7QNaAYsMi4I//qxq
dXONoPtzPrTpH4NJdnfyV+qGG8aHlPEeXAPvKHom92D/TVLu5KQICwqWRddaai9C
pFpDXUu/Tsm2DfFIte6QhKdWXq8tKA==
=rA+y
-END PGP SIGNATURE-