Re: Virtualmin and Webmin web hosting control panel are written in Perl 5

2022-08-03 Thread Will Coleda
Sorry this list is for users of the programming language Raku, which
was formerly known as "Perl 6".

For Perl support, I'd recommend starting at https://www.perl.org/

Best of luck.

On Mon, Aug 1, 2022 at 4:16 AM Turritopsis Dohrnii Teo En Ming
 wrote:
>
> Subject: Virtualmin and Webmin web hosting control panel are written in Perl 5
>
> Good day from Singapore,
>
> I understand that Virtualmin and Webmin web hosting control panel are
> written in Perl 5.
>
> Source: In which perl framework is webmin written into?
> Link: https://archive.virtualmin.com/node/36615
>
> If I want to learn Perl programming language from scratch having
> totally no knowledge of it, how long (in terms of months or years)
> would it take before I can confidently and proficiently modify
> Virtualmin and Webmin code?
>
> Hopefully there is no steep learning curve.
>
> Thank you.
>
> Regards,
>
> Mr. Turritopsis Dohrnii Teo En Ming
> Targeted Individual in Singapore
> 1 Aug 2022 Mon
> Blogs:
> https://tdtemcerts.blogspot.com
> https://tdtemcerts.wordpress.com


Virtualmin and Webmin web hosting control panel are written in Perl 5

2022-08-01 Thread Turritopsis Dohrnii Teo En Ming
Subject: Virtualmin and Webmin web hosting control panel are written in Perl 5

Good day from Singapore,

I understand that Virtualmin and Webmin web hosting control panel are
written in Perl 5.

Source: In which perl framework is webmin written into?
Link: https://archive.virtualmin.com/node/36615

If I want to learn Perl programming language from scratch having
totally no knowledge of it, how long (in terms of months or years)
would it take before I can confidently and proficiently modify
Virtualmin and Webmin code?

Hopefully there is no steep learning curve.

Thank you.

Regards,

Mr. Turritopsis Dohrnii Teo En Ming
Targeted Individual in Singapore
1 Aug 2022 Mon
Blogs:
https://tdtemcerts.blogspot.com
https://tdtemcerts.wordpress.com


Virtualmin and Webmin web hosting control panel are written in Perl 5

2022-08-01 Thread Turritopsis Dohrnii Teo En Ming
Subject: Virtualmin and Webmin web hosting control panel are written in Perl 5

Good day from Singapore,

I understand that Virtualmin and Webmin web hosting control panel are
written in Perl 5.

Source: In which perl framework is webmin written into?
Link: https://archive.virtualmin.com/node/36615

If I want to learn Perl programming language from scratch having
totally no knowledge of it, how long (in terms of months or years)
would it take before I can confidently and proficiently modify
Virtualmin and Webmin code?

Hopefully there is no steep learning curve.

Thank you.

Regards,

Mr. Turritopsis Dohrnii Teo En Ming
Targeted Individual in Singapore
1 Aug 2022 Mon
Blogs:
https://tdtemcerts.blogspot.com
https://tdtemcerts.wordpress.com


Re: Perl 5 list assignment idiom

2021-11-13 Thread rir


On Mon, Mar 13, 2017 at 11:32:25AM -0700, Sean McAfee wrote:
> In Perl 5 ...

> 1 == (my ($script) = $page->find('//script'))
>   or die "Other than exactly one script element found";

> Can a similar expression that avoids an intermediate array variable be
> written in Perl 6?

This does that:

1 == ( my $script = {1,}() ).elems or die 'Not a 1 element list.';

Rob


Passing on Fates [was: Re: Teaching Rakudo the tricks of Perl 5's regex optimiser]

2019-08-13 Thread Timo Paulssen
On 13/08/2019 16:32, Brad Gilbert wrote:

> Perhaps the biggest one may be the one about passing around “fates”.
> (I barely understand the basics of this.)


The optimization opportunity Brad is refering to here is relevant mostly
to grammars with deeply nested multi-tokens:

Longest-Token-Matching is implemented by creating an NFA
(nondeterministic finite automaton) out of all the longest declarative
prefixes that go into a given multi, be it with explicit | operators or
with "proto token"/"multi token" etc.

The NFA runs and collects a list of potential decision outcomes that are
valid. Think of them simply as "which method to call" and ignore
explicit | operators for the moment.

An important thing to note about the NFA that get created is that in
order to have the actual full "longest declarative prefix", they need to
incorporate every subrule that can be reached.

Take this simplified example:

A  can be a , a , a , etc.
a  can be an , a , a , etc.
an  can be  or 
a  is basically <[-+]><[1..9]><[0..9]>*
a  is basically <[-+]>0<[obdx]><[1..9 a..f]><[0..9 a..f]>*

Now what does the regex engine currently do when it sees "0xaffe"?

 1. It runs the NFA for , which is able to successfully match the
entirety of "0xaffe" and points towards "literal" as the result.
 2. Then it calls the  subrule.
 3. It runs the NFA for , which is able to successfully match
the entirety of "0xaffe" and points towards "integer" as the result.
 4. Then it calls the  subrule.
 5. It runs the NFA for , which is able to successfully match
the entirety of "0xaffe" and points towards "basedInteger" as the
result.
 6. Then it calls the  subrule.
 7. Then it parses the whole thing.

As you can see, it runs three separate NFAs against the same text,
starting before 0 and ending after e.

The idea of passing on fates is that the first NFA already knows that
after  is called, it will directly call into , and
then directly into . However, it does not currently have a
way to communicate deeper results to the regex engine.

I hope that explanation makes sense even if you're not deep in the regex
engine with your head already.

Kind Regards
  - Timo



Re: Teaching Rakudo the tricks of Perl 5's regex optimiser

2019-08-13 Thread Timo Paulssen
Here's some stuff that anybody who wants to work on regex optimization
in perl6 will want to know:

You can get a print-out of rakudo's internal AST that is generated for
the regex by passing --target=ast or --target=optimize to the perl6
commandline. I recommend grep -C5 Regex to skip some of the boilerplate
that's always there, but not important for regex stuff.

Here's an example of the output for the optimized p6 regex /foo/:

> - QAST::Regex(:rxtype(concat) :subtype())
>   - QAST::Regex(:rxtype(scan) :subtype())
>     - foo
>   - QAST::Regex(:rxtype(concat) :subtype())  foo
>     - QAST::Regex(:rxtype(literal) :subtype())  f
>   - foo
>     - QAST::Regex(:rxtype(literal) :subtype(zerowidth))  b
>   - bar
>   - QAST::Regex(:rxtype(pass) :subtype())

And here it is before optimization:

> - QAST::Regex(:rxtype(concat) :subtype())
>   - QAST::Regex(:rxtype(scan) :subtype())
>     - foo
>   - QAST::Regex(:rxtype(concat) :subtype())  foo
>     - QAST::Regex(:rxtype(literal) :subtype())  f
>   - foo
>     - QAST::Regex(:rxtype(subrule) :subtype(zerowidth) :name(before)) 
> 
>   - QAST::NodeList
>     - QAST::SVal(before)
>     - QAST::Block(:cuid(1))  :orig_qast :code_object
>   - QAST::Var(local self :decl(param))
>   - QAST::Var(lexical $¢ :decl(var))
>   - QAST::Regex(:rxtype(concat) :subtype())
>     - QAST::Regex(:rxtype(scan) :subtype())
>   - bar
>     - QAST::Regex(:rxtype(concat) :subtype())  bar
>   - QAST::Regex(:rxtype(literal) :subtype())  b
>     - bar
>     - QAST::Regex(:rxtype(pass) :subtype())
>   - QAST::Regex(:rxtype(pass) :subtype())

As you can see, it shrunk quite a bit; Before optimization, the "bar"
inside of  was put into the regex as a subrule with its own
complete block with lexical variables and everything. On top of that,
there was a scan operation there, which is normal for regexes in
general, but not useful for a lookahead or lookbehind (since they are
anchored implicitly). The optimizer simply turns all of that into a
"literal" "zerowidth" for "bar".

If you want to see how all that is currently implemented, you can look
at nqp's QRegex::Optimizer. The method "simplify_assertion" is probably
what does the optimization i outlined in the previous paragraph:
https://github.com/perl6/nqp/blob/master/src/QRegex/P6Regex/Optimizer.nqp#L88

Here's a perl6 one-liner that lets you eval a piece of perl6 code and
get the optimized QAST result as a tree of QAST nodes:

> perl6 -e 'use Perl6::Compiler:from; use nqp; say
> nqp::getcomp("perl6").eval(Q[/foo/], :target).dump'
Perhaps prototyping optimizations would be easiest in perl6 and later
translated into nqp.

If you want to hack on the "actual" regex optimizer, I recommend writing
your test code as nqp scripts; nqp is quickly recompiled to have the new
optimizer in it, and it applies the same way to perl6 regexes as it does
to nqp regexes. Running a rakudo with the changed optimizer requires a
full rebuild of rakudo, which of course includes the core setting.

The main optimization opportunities I can see for perl6 regexes are
exactly what nick points out in his mail:

If you can find out that a regex can only match if the target string
contains a certain substring (or even a short list of substrings that
can be or'd together would be interesting), you can generate code that
does a quick first check.

If you can prove that a specific part of the regex has a certain minimum
length, any scan through the target string can be aborted further from
the end. If the regex starts with a lookbehind that has a known minimum
length, the regex match attempt doesn't have to start at the very
beginning of the string.

I'm not entirely sure how we should go about skipping the regex engine
when a "simple match" can quickly be created, though.

On 13/08/2019 11:36, Nicholas Clark wrote:
> I'm cheating here - I'm using an e-mail message as a way to publish some notes
> for Jonathan (or *anyone else interested*):
>
> Jonathan did a talk in Riga, Perl 6 performance update,
> https://perlcon.eu/talk/80
> The (re-uploaded) live stream is at
> https://www.youtube.com/watch?v=S5iVBlk7pdg#t=4h39m
>
> One thing that this talk revealed is that (currently) Perl 5 beats
> Rakudo on various regular expressions. What *I* know is that this is because
> Perl 5 cheats - it has an "optimiser", which happens to automatically do
> what jnthn then showed manually implemented in some of his benchmarks.
>
> You can see what the Perl 5 regex optimiser is doing by using the re pragma.
> I'm no expert on this thing, but playing with it, I can see that it can do
> various things
>
> 0) Know that it can't do anything useful (it 

Re: Teaching Rakudo the tricks of Perl 5's regex optimiser

2019-08-13 Thread Patrick R. Michaud
FWIW, at one time there was discussion that "" and "" 
are actually keywords and not typical method calls that can be overridden,
precisely so optimizations can be made.  They're that important to
efficient running of the regexes.


I'm not sure that a formal decision was ever made on this, however.
(I'd be okay with declaring them as keywords that cannot be overridden.)

Pm

On Tue, Aug 13, 2019 at 05:01:06PM +0200, Timo Paulssen wrote:
> 
> >     use v6;
> >     'abcd' ~~ / . <.before( /c/ )> .  / # "bc"
> >     'abcd' ~~ / . <.before   c   > .  / # "bc" # (exactly identical)
> >
> > A person could change the code in the `before` method to have it do
> > something different
> 
> 
> At least at the moment, that's not 100% accurate (only by virtue of
> leaving out a piece):
> 
> timo@schmand ~> perl6 -e 'grammar test { regex before($re) { { say "yo"
> } }; regex TOP { <.before "hi"> } }; test.parse("hi")'
> yo
> Too few positionals passed; expected 2 arguments but got 1
>   in regex before at -e line 1
>   in regex TOP at -e line 1
>   in block  at -e line 1
> 
> timo@schmand ~ [1]> perl6 -e 'grammar test { regex before($re) { { say
> "yo" } }; regex TOP {  } }; test.parse("hi")'
> yo
> Too few positionals passed; expected 2 arguments but got 1
>   in regex before at -e line 1
>   in regex TOP at -e line 1
>   in block  at -e line 1
> 
> timo@schmand ~ [1]> perl6 -e 'grammar test { regex before($re) { { say
> "yo" } }; regex TOP {  } }; test.parse("hi")'
> 
> As you can see, using  gives you the "real" lookahead assertion.
> 
> I'm not sure if that's part of the language yet, but should probably
> made to be.
> 
> 
> This will allow more optimization efforts.


Re: Teaching Rakudo the tricks of Perl 5's regex optimiser

2019-08-13 Thread Timo Paulssen


>     use v6;
>     'abcd' ~~ / . <.before( /c/ )> .  / # "bc"
>     'abcd' ~~ / . <.before   c   > .  / # "bc" # (exactly identical)
>
> A person could change the code in the `before` method to have it do
> something different


At least at the moment, that's not 100% accurate (only by virtue of
leaving out a piece):

timo@schmand ~> perl6 -e 'grammar test { regex before($re) { { say "yo"
} }; regex TOP { <.before "hi"> } }; test.parse("hi")'
yo
Too few positionals passed; expected 2 arguments but got 1
  in regex before at -e line 1
  in regex TOP at -e line 1
  in block  at -e line 1

timo@schmand ~ [1]> perl6 -e 'grammar test { regex before($re) { { say
"yo" } }; regex TOP {  } }; test.parse("hi")'
yo
Too few positionals passed; expected 2 arguments but got 1
  in regex before at -e line 1
  in regex TOP at -e line 1
  in block  at -e line 1

timo@schmand ~ [1]> perl6 -e 'grammar test { regex before($re) { { say
"yo" } }; regex TOP {  } }; test.parse("hi")'

As you can see, using  gives you the "real" lookahead assertion.

I'm not sure if that's part of the language yet, but should probably
made to be.


This will allow more optimization efforts.


Re: Teaching Rakudo the tricks of Perl 5's regex optimiser

2019-08-13 Thread Brad Gilbert
I would like to point out that regexes in Perl6 are treated as code.
(They can even have parameters and lexical variables.)

It uses the same compiler intrinsics as the rest of Perl6.
It uses the same VM opcodes as regular Perl6 code.

Regexes, string literals, and signatures are just domain specific
sub-languages.

Perl6 regexes are also missing features that are common to other regexes,
instead you just embed regular Perl6 code to handle it.

For example instead of `(?=…)` Perl6 uses a method call to `before` with a
regex argument.

<.before …>

use v5;
'abcd' =~ / . (?=c) . /x # "bc"

use v6;
'abcd' ~~ / . <.before( /c/ )> .  / # "bc"
'abcd' ~~ / . <.before   c   > .  / # "bc" # (exactly identical)

A person could change the code in the `before` method to have it do
something different

This means that the biggest wins in the Perl6 regex system are probably
going to look nothing like the ones in other regex engines.
At least in the short term.
Inlining method calls for instance.
Perhaps the biggest one may be the one about passing around “fates”. (I
barely understand the basics of this.)

So while information on how other projects do regex optimizations can help,
they are generally going to be small wins in comparison.
(That doesn't mean they aren't worth doing.)

Doing some of those optimizations may also make other bigger optimizations
harder to do.
(I'm fairly sure the “fates” optimization would be harder, but I'm not
sure.)

On Tue, Aug 13, 2019 at 4:53 AM Nicholas Clark  wrote:

> I'm cheating here - I'm using an e-mail message as a way to publish some
> notes
> for Jonathan (or *anyone else interested*):
>
> Jonathan did a talk in Riga, Perl 6 performance update,
> https://perlcon.eu/talk/80
> The (re-uploaded) live stream is at
> https://www.youtube.com/watch?v=S5iVBlk7pdg#t=4h39m
>
> One thing that this talk revealed is that (currently) Perl 5 beats
> Rakudo on various regular expressions. What *I* know is that this is
> because
> Perl 5 cheats - it has an "optimiser", which happens to automatically do
> what jnthn then showed manually implemented in some of his benchmarks.
>
> You can see what the Perl 5 regex optimiser is doing by using the re
> pragma.
> I'm no expert on this thing, but playing with it, I can see that it can do
> various things
>
> 0) Know that it can't do anything useful (it is skipped)
> 1) Know that a fixed string must be present
>Look for it (which is fast), not find it, and immediately return "no
> match"
> 2) Know that a fixed string must be present
>Look for it find it, carry on into the real engine
>(which arguably is slower than no optimiser)
> 3) Know that a fixed string must be present, *and* is the entire match
>Look for it (which is fast), find it, and immediately return "match".
>
> Clearly cases (1) and (3) are the big wins here. Case (3) was the one I had
> forgotten about - the cheating is so good that often the engine is never
> entered.
>
>
> So, if you run this:
>
> $ perl -wle 'use re "debug"; print "Perl rules" =~ /^Perl/ ? "Y" : "n"'
> Compiling REx "^Perl"
> Final program:
>1: SBOL /^/ (2)
>2: EXACT  (4)
>4: END (0)
> anchored "Perl" at 0 (checking anchored noscan) anchored(SBOL) minlen 4
> Matching REx "^Perl" against "Perl rules"
> Intuit: trying to determine minimum start position...
>   Looking for check substr at fixed offset 0...
> Intuit: Successfully guessed: match at offset 0
>0 <>  |   0| 1:SBOL /^/(2)
>0 <>  |   0| 2:EXACT (4)
>4  < rules> |   0| 4:END(0)
> Match successful!
> Y
> Freeing REx: "^Perl"
>
>
> "Final program" describes how the regex ended up being compiled. This isn't
> really of interest here.
>
> What is of interest is the parts between the two lines "Intuit". That's the
> optimiser. For the case I specifically chose here, what we have is that
>
> 1) the optimiser knows that the fixed string "Perl" must be in target
> string
> 2) which it searches for and finds
> 3) at which point it calls the main engine (these lines):
>
>0 <>  |   0| 1:SBOL /^/(2)
>0 <>  |   0| 2:EXACT (4)
>4  < rules> |   0| 4:END(0)
>
> (that part isn't actually of interest here. I'm just noting it as "this is
> the main engine, and comparable to what Rakudo does).
>
>
> The interesting cases are things like:
>
> $ perl -wle 'use re "debug"; print "Perl rules" =~ /er./ ? "Y" : "n"'
> Compiling REx "er."
> Final pr

Teaching Rakudo the tricks of Perl 5's regex optimiser

2019-08-13 Thread Nicholas Clark
I'm cheating here - I'm using an e-mail message as a way to publish some notes
for Jonathan (or *anyone else interested*):

Jonathan did a talk in Riga, Perl 6 performance update,
https://perlcon.eu/talk/80
The (re-uploaded) live stream is at
https://www.youtube.com/watch?v=S5iVBlk7pdg#t=4h39m

One thing that this talk revealed is that (currently) Perl 5 beats
Rakudo on various regular expressions. What *I* know is that this is because
Perl 5 cheats - it has an "optimiser", which happens to automatically do
what jnthn then showed manually implemented in some of his benchmarks.

You can see what the Perl 5 regex optimiser is doing by using the re pragma.
I'm no expert on this thing, but playing with it, I can see that it can do
various things

0) Know that it can't do anything useful (it is skipped)
1) Know that a fixed string must be present
   Look for it (which is fast), not find it, and immediately return "no match"
2) Know that a fixed string must be present
   Look for it find it, carry on into the real engine
   (which arguably is slower than no optimiser)
3) Know that a fixed string must be present, *and* is the entire match
   Look for it (which is fast), find it, and immediately return "match".

Clearly cases (1) and (3) are the big wins here. Case (3) was the one I had
forgotten about - the cheating is so good that often the engine is never
entered.
   

So, if you run this:

$ perl -wle 'use re "debug"; print "Perl rules" =~ /^Perl/ ? "Y" : "n"'
Compiling REx "^Perl"
Final program:
   1: SBOL /^/ (2)
   2: EXACT  (4)
   4: END (0)
anchored "Perl" at 0 (checking anchored noscan) anchored(SBOL) minlen 4
Matching REx "^Perl" against "Perl rules"
Intuit: trying to determine minimum start position...
  Looking for check substr at fixed offset 0...
Intuit: Successfully guessed: match at offset 0
   0 <>  |   0| 1:SBOL /^/(2)
   0 <>  |   0| 2:EXACT (4)
   4  < rules> |   0| 4:END(0)
Match successful!
Y
Freeing REx: "^Perl"


"Final program" describes how the regex ended up being compiled. This isn't
really of interest here.

What is of interest is the parts between the two lines "Intuit". That's the
optimiser. For the case I specifically chose here, what we have is that

1) the optimiser knows that the fixed string "Perl" must be in target string
2) which it searches for and finds
3) at which point it calls the main engine (these lines):

   0 <>  |   0| 1:SBOL /^/(2)
   0 <>  |   0| 2:EXACT (4)
   4  < rules> |   0| 4:END(0)

(that part isn't actually of interest here. I'm just noting it as "this is
the main engine, and comparable to what Rakudo does).


The interesting cases are things like:

$ perl -wle 'use re "debug"; print "Perl rules" =~ /er./ ? "Y" : "n"'
Compiling REx "er."
Final program:
   1: EXACT  (3)
   3: REG_ANY (4)
   4: END (0)
anchored "er" at 0 (checking anchored) minlen 3
Matching REx "er." against "Perl rules"
Intuit: trying to determine minimum start position...
  doing 'check' fbm scan, [0..9] gave 1
  Found anchored substr "er" at offset 1 (rx_origin now 1)...
  (multiline anchor test skipped)
  try at offset...
Intuit: Successfully guessed: match at offset 1
   1   |   0| 1:EXACT (3)
   3   |   0| 3:REG_ANY(4)
   4  < rules> |   0| 4:END(0)
Match successful!
Y
Freeing REx: "er."


You can see that
1) the compiler records that the longest fixed string is 'er'
2) the optimiser looks for this before even hitting the real engine
3) the optimiser tells the real engine that it doesn't even need to consider
   trying to match at string offset 0


and this:

$ perl -wle 'use re "debug"; print "Perl rules" =~ /er/ ? "Y" : "n"'
Compiling REx "er"
Final program:
   1: EXACT  (3)
   3: END (0)
anchored "er" at 0 (checking anchored isall) minlen 2
Matching REx "er" against "Perl rules"
Intuit: trying to determine minimum start position...
  doing 'check' fbm scan, [0..10] gave 1
  Found anchored substr "er" at offset 1 (rx_origin now 1)...
  (multiline anchor test skipped)
  try at offset...
Intuit: Successfully guessed: match at offset 1
Y
Freeing REx: "er"


The optimiser matches, and knows that if its crib[1] matches, the entire
regex must match, so it doesn't even call into the engine.


and this:

$ perl -wle 'use re "debug"; print "Perl rules" =~ /Good *, #MoarVM/ ? "Y" : 
"n"'
Compiling REx "Good *, #MoarVM"
Final program:
   1: EXACT  (3)
   3: STAR (6)
   4:   EXACT < > (0)
   6: EXACT <, #MoarVM> (10)
  10: END (0)
anchored "Good" at 0 floating &

Re: Need help converting from Perl 5

2018-05-15 Thread JJ Merelo
As far as I understand it, HTTP::UserAgent is preferred over LWP::Simple.
It does work to spec now, so I'm using it...

El mar., 15 may. 2018 a las 8:44, ToddAndMargo (<toddandma...@zoho.com>)
escribió:

> On 05/14/2018 02:42 AM, JJ Merelo wrote:
> > Maybe this will work
> >
> > use HTTP::UserAgent;
> >
> > my $ua = HTTP::UserAgent.new;
> > $ua.timeout = 10;
> >
> > my $response = $ua.get("https://ftp.mozilla.org/pub/firefox/releases/;);
> >
> > if $response.is-success {
> >  say $response.content ~~ m:g{\> (\d+ \. .+?) \/};
> > }
>
> Hi JJ,
>
> Thank you for the regex!  There are 1001 way to do things
> in Perl!
>
> I tested HTTP::UserAgent months ago.  I don't remember exactly
> what did not work right, but I wound up writing myself
> a module to interface with "curl", where there are no issues
> with redirects, user agent stings, cookies, and such.
>
> My curl module also allows me to send eMail, including SSL
> and one attachment.
>
> The one drawback of Perl 6 over Perl 5 is the lack of
> mature module support, but things are always improving!
>
> :-)
>
> -T
>


-- 
JJ


Re: Need help converting from Perl 5

2018-05-15 Thread ToddAndMargo

On 05/14/2018 02:42 AM, JJ Merelo wrote:

Maybe this will work

use HTTP::UserAgent;

my $ua = HTTP::UserAgent.new;
$ua.timeout = 10;

my $response = $ua.get("https://ftp.mozilla.org/pub/firefox/releases/;);

if $response.is-success {
     say $response.content ~~ m:g{\> (\d+ \. .+?) \/};
}


Hi JJ,

Thank you for the regex!  There are 1001 way to do things
in Perl!

I tested HTTP::UserAgent months ago.  I don't remember exactly
what did not work right, but I wound up writing myself
a module to interface with "curl", where there are no issues
with redirects, user agent stings, cookies, and such.

My curl module also allows me to send eMail, including SSL
and one attachment.

The one drawback of Perl 6 over Perl 5 is the lack of
mature module support, but things are always improving!

:-)

-T


Re: Need help converting from Perl 5

2018-05-14 Thread Shlomi Fish
Hi Todd,

On Sun, 13 May 2018 22:07:59 -0700
ToddAndMargo <toddandma...@zoho.com> wrote:

> On 05/13/2018 09:41 PM, ToddAndMargo wrote:
> > Hi All,
> > 
> > I can't not remember what I did in Perl 5 here and
> > am not having a good time converting it to Perl 6.
> > 
> > $  perl -e 'my $A="44.rc0"; if ($A ~~ /(^[0-9,.,a,b,rc]+$)/ ) {print 
> > "$1\n";} else {print "\$A = <$A>\n"}'
> > 
> > 44.rc0
> > 
> > The actual code is:
> > if ( $Line2 ~~ /(^[0-9,.]+$)/ ) { push ( @WebVersions, $Line2 ); }
> > 
> > The actual data looks like:
> > 
> > $Line2 = 6.0.1
> > $Line2 = 6.0.2
> > $Line2 = 6.0
> > $Line2 = 6.0b1
> > $Line2 = 6.0b2
> > $Line2 = 6.0b3
> > $Line2 = 6.0b4
> > $Line2 = 6.0b5
> > $Line2 = 60.0
> > $Line2 = 60.0b10
> > $Line2 = 60.0b11
> > $Line2 = 60.0b12
> > 
> > I am trying to exclude things that look like:
> > 
> > $Line2 = bonecho
> > $Line2 = custom-updates
> > $Line2 = deerpark
> > $Line2 = devpreview
> > $Line2 = granparadiso
> > $Line2 = latest-beta
> > $Line2 = latest-esr
> > 
> > 
> > Many thanks,
> > -T  
> 
> perl6.org is down by the way.
> 

https://docs.perl6.org/type.html and https://perl6.org/ seem fine from here now
- please try again.

> Is this right?
> 
> perl6 -e 'my $A="44.rc20"; if $A ~~ m/( \d**1..4 "." ( "a" | "b" | "rc" 
> ) .*$ ) /  {say "$0";} else {say "no match";}'
> 
> 44.rc20
> 
> 
> 



-- 
-
Shlomi Fish   http://www.shlomifish.org/
Best Introductory Programming Language - http://shlom.in/intro-lang

*Harry*: Yes, it is obvious that this pig is the most beautiful person for
miles.
*Miss Piggy*: Indeed. Candice Swanepoel ain’t got nothing on… Moi!
— http://is.gd/zsmond

Please reply to list if it's a mailing list post - http://shlom.in/reply .


Re: Need help converting from Perl 5

2018-05-14 Thread JJ Merelo
Maybe this will work

use HTTP::UserAgent;

my $ua = HTTP::UserAgent.new;
$ua.timeout = 10;

my $response = $ua.get("https://ftp.mozilla.org/pub/firefox/releases/;);

if $response.is-success {
say $response.content ~~ m:g{\> (\d+ \. .+?) \/};
}
..

Please post also your question to StackOverflow, you might have better
answers there. This one works directly on the HTML source, but you will
just need to take out \> and \/ to use other. Also it's a global one, if
you work by lines it might be simpler.

El lun., 14 may. 2018 a las 11:21, ToddAndMargo (<toddandma...@zoho.com>)
escribió:

> >> El lun., 14 may. 2018 a las 7:08, ToddAndMargo (<toddandma...@zoho.com
> >> <mailto:toddandma...@zoho.com>>) escribió:
> >>
> >> On 05/13/2018 09:41 PM, ToddAndMargo wrote:
> >>  > Hi All,
> >>  >
> >>  > I can't not remember what I did in Perl 5 here and
> >>  > am not having a good time converting it to Perl 6.
> >>  >
> >>  > $  perl -e 'my $A="44.rc0"; if ($A ~~ /(^[0-9,.,a,b,rc]+$)/ )
> {print
> >>  > "$1\n";} else {print "\$A = <$A>\n"}'
> >>  >
> >>  > 44.rc0
> >>  >
> >>  > The actual code is:
> >>  > if ( $Line2 ~~ /(^[0-9,.]+$)/ ) { push ( @WebVersions, $Line2 );
> }
> >>  >
> >>  > The actual data looks like:
> >>  >
> >>  > $Line2 = 6.0.1
> >>  > $Line2 = 6.0.2
> >>  > $Line2 = 6.0
> >>  > $Line2 = 6.0b1
> >>  > $Line2 = 6.0b2
> >>  > $Line2 = 6.0b3
> >>  > $Line2 = 6.0b4
> >>  > $Line2 = 6.0b5
> >>  > $Line2 = 60.0
> >>  > $Line2 = 60.0b10
> >>  > $Line2 = 60.0b11
> >>  > $Line2 = 60.0b12
> >>  >
> >>  > I am trying to exclude things that look like:
> >>  >
> >>  > $Line2 = bonecho
> >>  > $Line2 = custom-updates
> >>  > $Line2 = deerpark
> >>  > $Line2 = devpreview
> >>  > $Line2 = granparadiso
> >>  > $Line2 = latest-beta
> >>  > $Line2 = latest-esr
> >>  >
> >>  >
> >>  > Many thanks,
> >>  > -T
> >>
> >> perl6.org <http://perl6.org> is down by the way.
> >>
> >> Is this right?
> >>
> >> perl6 -e 'my $A="44.rc20"; if $A ~~ m/( \d**1..4 "." ( "a" | "b" |
> "rc"
> >> ) .*$ ) /  {say "$0";} else {say "no match";}'
> >>
> >> 44.rc20
> >>
>
> On 05/13/2018 11:41 PM, JJ Merelo wrote:
> > You want to exclude lines starting with an alphabetic character, or
> > which are composed exclusively by alphabetic characters?
> >
>
>
> I am trying to separate revision numbers (60.0.1, 20.0b5) from
> extraneous directories (latest-esr, 20.0.1-funnelcake22)
>
> You can see a full list before I have at it here:
>
> https://ftp.mozilla.org/pub/firefox/releases/
>
> I just want current releases
>


-- 
JJ


Re: Need help converting from Perl 5

2018-05-14 Thread ToddAndMargo
El lun., 14 may. 2018 a las 7:08, ToddAndMargo (<toddandma...@zoho.com 
<mailto:toddandma...@zoho.com>>) escribió:


On 05/13/2018 09:41 PM, ToddAndMargo wrote:
 > Hi All,
 >
 > I can't not remember what I did in Perl 5 here and
 > am not having a good time converting it to Perl 6.
 >
 > $  perl -e 'my $A="44.rc0"; if ($A ~~ /(^[0-9,.,a,b,rc]+$)/ ) {print
 > "$1\n";} else {print "\$A = <$A>\n"}'
 >
 > 44.rc0
 >
 > The actual code is:
 > if ( $Line2 ~~ /(^[0-9,.]+$)/ ) { push ( @WebVersions, $Line2 ); }
 >
 > The actual data looks like:
 >
 > $Line2 = 6.0.1
 > $Line2 = 6.0.2
 > $Line2 = 6.0
 > $Line2 = 6.0b1
 > $Line2 = 6.0b2
 > $Line2 = 6.0b3
 > $Line2 = 6.0b4
 > $Line2 = 6.0b5
 > $Line2 = 60.0
 > $Line2 = 60.0b10
 > $Line2 = 60.0b11
 > $Line2 = 60.0b12
 >
 > I am trying to exclude things that look like:
 >
 > $Line2 = bonecho
 > $Line2 = custom-updates
 > $Line2 = deerpark
 > $Line2 = devpreview
 > $Line2 = granparadiso
 > $Line2 = latest-beta
 > $Line2 = latest-esr
 >
 >
 > Many thanks,
 > -T

perl6.org <http://perl6.org> is down by the way.

Is this right?

perl6 -e 'my $A="44.rc20"; if $A ~~ m/( \d**1..4 "." ( "a" | "b" | "rc"
) .*$ ) /  {say "$0";} else {say "no match";}'

44.rc20



On 05/13/2018 11:41 PM, JJ Merelo wrote:
You want to exclude lines starting with an alphabetic character, or 
which are composed exclusively by alphabetic characters?





I am trying to separate revision numbers (60.0.1, 20.0b5) from
extraneous directories (latest-esr, 20.0.1-funnelcake22)

You can see a full list before I have at it here:

https://ftp.mozilla.org/pub/firefox/releases/

I just want current releases


Re: Need help converting from Perl 5

2018-05-13 Thread ToddAndMargo

On 05/13/2018 09:41 PM, ToddAndMargo wrote:

Hi All,

I can't not remember what I did in Perl 5 here and
am not having a good time converting it to Perl 6.

$  perl -e 'my $A="44.rc0"; if ($A ~~ /(^[0-9,.,a,b,rc]+$)/ ) {print 
"$1\n";} else {print "\$A = <$A>\n"}'


44.rc0

The actual code is:
if ( $Line2 ~~ /(^[0-9,.]+$)/ ) { push ( @WebVersions, $Line2 ); }

The actual data looks like:

$Line2 = 6.0.1
$Line2 = 6.0.2
$Line2 = 6.0
$Line2 = 6.0b1
$Line2 = 6.0b2
$Line2 = 6.0b3
$Line2 = 6.0b4
$Line2 = 6.0b5
$Line2 = 60.0
$Line2 = 60.0b10
$Line2 = 60.0b11
$Line2 = 60.0b12

I am trying to exclude things that look like:

$Line2 = bonecho
$Line2 = custom-updates
$Line2 = deerpark
$Line2 = devpreview
$Line2 = granparadiso
$Line2 = latest-beta
$Line2 = latest-esr


Many thanks,
-T


perl6.org is down by the way.

Is this right?

perl6 -e 'my $A="44.rc20"; if $A ~~ m/( \d**1..4 "." ( "a" | "b" | "rc" 
) .*$ ) /  {say "$0";} else {say "no match";}'


44.rc20



--
~~
Computers are like air conditioners.
They malfunction when you open windows
~~


Need help converting from Perl 5

2018-05-13 Thread ToddAndMargo

Hi All,

I can't not remember what I did in Perl 5 here and
am not having a good time converting it to Perl 6.

$  perl -e 'my $A="44.rc0"; if ($A ~~ /(^[0-9,.,a,b,rc]+$)/ ) {print 
"$1\n";} else {print "\$A = <$A>\n"}'


44.rc0

The actual code is:
if ( $Line2 ~~ /(^[0-9,.]+$)/ ) { push ( @WebVersions, $Line2 ); }

The actual data looks like:

$Line2 = 6.0.1
$Line2 = 6.0.2
$Line2 = 6.0
$Line2 = 6.0b1
$Line2 = 6.0b2
$Line2 = 6.0b3
$Line2 = 6.0b4
$Line2 = 6.0b5
$Line2 = 60.0
$Line2 = 60.0b10
$Line2 = 60.0b11
$Line2 = 60.0b12

I am trying to exclude things that look like:

$Line2 = bonecho
$Line2 = custom-updates
$Line2 = deerpark
$Line2 = devpreview
$Line2 = granparadiso
$Line2 = latest-beta
$Line2 = latest-esr


Many thanks,
-T


Re: [perl #129941] [PERF] [IO] Perl 6 text file line read is much slower than Perl 5

2017-09-12 Thread Tom Browder via RT
On Tue, Sep 12, 2017 at 09:23 jn...@jnthn.net via RT <
perl6-bugs-follo...@perl.org> wrote:

> On Mon, 24 Oct 2016 03:27:55 -0700, tbrowder wrote:
> > On Sat Oct 22 04:24:15 2016, tbrowder wrote:
> > > See <https://github.com/tbrowder/perl6-read-write-tests> for a suite
> > > of tests that show the differences.
> >
> > Suite has been updated considerably.
>
> In a benchmark on my local machine, after many improvements, I now see
> Perl 6 coming out slightly ahead of Perl 5 when the UTF-8 encoding is being
> used:

...

> The situation with ASCII/latin-1 is still not quite so rosy:
>
...

> Though that's now down to a factor of 3.5x, which is hugely better than
> the factor of 9 or 10 before.
>
> What are the conditions for resolving this issue? Clearly the UTF-8 case
> is good enough because Perl 6 is winning there, but "much slower" is a bit
> subjective, so hard to know when we're there (unless we somehow manage to
> win in the ASCII case too...) :-)
>

Jonathan, thanks for your continued work in this area. I agree that "much
slower" is not very specific.  Unless you are aware of some code remaining
to work on someday, I guess we are at the "good enough" point, especially
given that p6 is beating p5 in urf8!

Let me run my tests again to see how it "feels" in my world.

Best,

-Tom


Re: [perl #129941] [PERF] [IO] Perl 6 text file line read is much slower than Perl 5

2017-09-12 Thread Tom Browder
On Tue, Sep 12, 2017 at 09:23 jn...@jnthn.net via RT <
perl6-bugs-follo...@perl.org> wrote:

> On Mon, 24 Oct 2016 03:27:55 -0700, tbrowder wrote:
> > On Sat Oct 22 04:24:15 2016, tbrowder wrote:
> > > See <https://github.com/tbrowder/perl6-read-write-tests> for a suite
> > > of tests that show the differences.
> >
> > Suite has been updated considerably.
>
> In a benchmark on my local machine, after many improvements, I now see
> Perl 6 coming out slightly ahead of Perl 5 when the UTF-8 encoding is being
> used:

...

> The situation with ASCII/latin-1 is still not quite so rosy:
>
...

> Though that's now down to a factor of 3.5x, which is hugely better than
> the factor of 9 or 10 before.
>
> What are the conditions for resolving this issue? Clearly the UTF-8 case
> is good enough because Perl 6 is winning there, but "much slower" is a bit
> subjective, so hard to know when we're there (unless we somehow manage to
> win in the ASCII case too...) :-)
>

Jonathan, thanks for your continued work in this area. I agree that "much
slower" is not very specific.  Unless you are aware of some code remaining
to work on someday, I guess we are at the "good enough" point, especially
given that p6 is beating p5 in urf8!

Let me run my tests again to see how it "feels" in my world.

Best,

-Tom


[perl #129941] [PERF] [IO] Perl 6 text file line read is much slower than Perl 5

2017-09-12 Thread jn...@jnthn.net via RT
On Mon, 24 Oct 2016 03:27:55 -0700, tbrowder wrote:
> On Sat Oct 22 04:24:15 2016, tbrowder wrote:
> > See <https://github.com/tbrowder/perl6-read-write-tests> for a suite
> > of tests that show the differences.
> 
> Suite has been updated considerably.

In a benchmark on my local machine, after many improvements, I now see Perl 6 
coming out slightly ahead of Perl 5 when the UTF-8 encoding is being used:

$ time perl6 -e 'my $fh = open "longfile"; my $chars = 0; for $fh.lines { 
$chars = $chars + .chars }; $fh.close; say $chars'
6000

real0m1.081s
user0m1.168s
sys 0m0.032s

$ time perl -e 'open my $fh, "<:encoding(UTF-8)", "longfile"; my $chars = 0; 
while ($_ = <$fh>) { chomp; $chars = $chars + length($_) }; close $fh; print 
"$chars\n"'
6000

real0m1.110s
user0m1.088s
sys 0m0.020s

The situation with ASCII/latin-1 is still not quite so rosy:

$ time perl -e 'open my $fh, "<", "longfile"; my $chars = 0; while ($_ = <$fh>) 
{ chomp; $chars = $chars + length($_) }; close $fh; print "$chars\n"'
6000

real0m0.277s
user0m0.260s
sys 0m0.016s

$ time ./perl6-m -e 'my $fh = open "longfile", :enc; my $chars = 0; for 
$fh.lines { $chars = $chars + .chars }; $fh.close; say $chars'
6000

real0m0.988s
user0m1.028s
sys 0m0.068s

Though that's now down to a factor of 3.5x, which is hugely better than the 
factor of 9 or 10 before.

What are the conditions for resolving this issue? Clearly the UTF-8 case is 
good enough because Perl 6 is winning there, but "much slower" is a bit 
subjective, so hard to know when we're there (unless we somehow manage to win 
in the ASCII case too...) :-)

/jnthn


[perl #129941] [PERF] [IO] Perl 6 text file line read is much slower than Perl 5

2017-09-12 Thread jn...@jnthn.net via RT
On Mon, 24 Oct 2016 03:27:55 -0700, tbrowder wrote:
> On Sat Oct 22 04:24:15 2016, tbrowder wrote:
> > See <https://github.com/tbrowder/perl6-read-write-tests> for a suite
> > of tests that show the differences.
> 
> Suite has been updated considerably.

In a benchmark on my local machine, after many improvements, I now see Perl 6 
coming out slightly ahead of Perl 5 when the UTF-8 encoding is being used:

$ time perl6 -e 'my $fh = open "longfile"; my $chars = 0; for $fh.lines { 
$chars = $chars + .chars }; $fh.close; say $chars'
6000

real0m1.081s
user0m1.168s
sys 0m0.032s

$ time perl -e 'open my $fh, "<:encoding(UTF-8)", "longfile"; my $chars = 0; 
while ($_ = <$fh>) { chomp; $chars = $chars + length($_) }; close $fh; print 
"$chars\n"'
6000

real0m1.110s
user0m1.088s
sys 0m0.020s

The situation with ASCII/latin-1 is still not quite so rosy:

$ time perl -e 'open my $fh, "<", "longfile"; my $chars = 0; while ($_ = <$fh>) 
{ chomp; $chars = $chars + length($_) }; close $fh; print "$chars\n"'
6000

real0m0.277s
user0m0.260s
sys 0m0.016s

$ time ./perl6-m -e 'my $fh = open "longfile", :enc; my $chars = 0; for 
$fh.lines { $chars = $chars + .chars }; $fh.close; say $chars'
6000

real0m0.988s
user0m1.028s
sys 0m0.068s

Though that's now down to a factor of 3.5x, which is hugely better than the 
factor of 9 or 10 before.

What are the conditions for resolving this issue? Clearly the UTF-8 case is 
good enough because Perl 6 is winning there, but "much slower" is a bit 
subjective, so hard to know when we're there (unless we somehow manage to win 
in the ASCII case too...) :-)

/jnthn


Re: [perl #131076] [LTA] Rakudo sees Perl 5 code even if there is none (for $x(42), $x(50) {…})

2017-03-30 Thread Timo Paulssen
Of course there should have been a "," between (list) and $othervar.


Re: [perl #131076] [LTA] Rakudo sees Perl 5 code even if there is none (for $x(42), $x(50) {…})

2017-03-30 Thread Timo Paulssen
But perl5 won't accept

for $var (list) $othervar (anotherlist) { ... }

right?

So we definitely shouldn't complain, or at least we should point out the
workaround of putting a dot between $var and (list)

On 30/03/17 03:51, Brandon Allbery wrote:
> That *is* Perl 5 syntax, though; it looks like the schema
>
> for $var (list) { ... } # the space is not required between the
> var and the parenthesized list


Re: [perl #131076] [LTA] Rakudo sees Perl 5 code even if there is none (for $x(42), $x(50) {…})

2017-03-29 Thread Brandon Allbery
That *is* Perl 5 syntax, though; it looks like the schema

for $var (list) { ... } # the space is not required between the var and
the parenthesized list


On Wed, Mar 29, 2017 at 9:35 PM, Aleks-Daniel Jakimenko-Aleksejev <
perl6-bugs-follo...@perl.org> wrote:

> # New Ticket Created by  Aleks-Daniel Jakimenko-Aleksejev
> # Please include the string:  [perl #131076]
> # in the subject line of all future correspondence about this issue.
> # https://rt.perl.org/Ticket/Display.html?id=131076 >
>
>
> Code:
> my $x = *²; for $x(42), $x(50) { say $_ }
>
> Result:
> ===SORRY!=== Error while compiling -e
> This appears to be Perl 5 code
> at -e:1
> --> my $x = *²; for ⏏$x(42), $x(50) { say $_ }
>



-- 
brandon s allbery kf8nh   sine nomine associates
allber...@gmail.com  ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net


[perl #131076] [LTA] Rakudo sees Perl 5 code even if there is none (for $x(42), $x(50) {…})

2017-03-29 Thread via RT
# New Ticket Created by  Aleks-Daniel Jakimenko-Aleksejev 
# Please include the string:  [perl #131076]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/Ticket/Display.html?id=131076 >


Code:
my $x = *²; for $x(42), $x(50) { say $_ }

Result:
===SORRY!=== Error while compiling -e
This appears to be Perl 5 code
at -e:1
--> my $x = *²; for ⏏$x(42), $x(50) { say $_ }


Re: Perl 5 list assignment idiom

2017-03-13 Thread Brock Wilcox
The == operator coerces to Numeric, so like:

> sub one-thing { return ("hi",) }
sub one-thing () { #`(Sub|93867233982256) ... }
> one-thing.Numeric
1

(mentioned in https://docs.perl6.org/routine/$EQUALS_SIGN$EQUALS_SIGN)

I think my does indeed do some fancy precidenting with the assignment.

--Brock


On Mon, Mar 13, 2017 at 3:56 PM, Sean McAfee  wrote:

> sub one-thing { return ("hi",) }


Re: Perl 5 list assignment idiom

2017-03-13 Thread Sean McAfee
On Mon, Mar 13, 2017 at 12:37 PM, Will Coleda <w...@coleda.com> wrote:

> Works the same in Perl 6, and you can avoid the parens. Using helper
> subs that return one or two item lists, here's some sample code:
>
> $ perl6
> > sub one-thing { return ("hi",) }
> sub one-thing () { #`(Sub|140454852043936) ... }
> > 1 == my $script = one-thing
> True
> > $script
> (hi)
>
>
But then:

> $script.WHAT
(List)

In the Perl 5 version, $script is assigned the single element of the
returned list.  In your code, it refers to the list itself.

(Also, wait: It looks like "=" has higher precedence than "=="?  Or does
the "my" affect the parsing somehow?)


Re: Perl 5 list assignment idiom

2017-03-13 Thread Will Coleda
Works the same in Perl 6, and you can avoid the parens. Using helper
subs that return one or two item lists, here's some sample code:

$ perl6
> sub one-thing { return ("hi",) }
sub one-thing () { #`(Sub|140454852043936) ... }
> 1 == my $script = one-thing
True
> $script
(hi)


> sub two-things { return  }
sub two-things () { #`(Sub|140454852044088) ... }
> 1 == my $bar = two-things
False
> $bar
(hi there)



On Mon, Mar 13, 2017 at 2:32 PM, Sean McAfee <eef...@gmail.com> wrote:
> In Perl 5, list assignment in scalar context evaluates to the number of list
> elements on the right-hand side.  That enables an idiom that I rather like:
>
> 1 == (my ($script) = $page->find('//script'))
>   or die "Other than exactly one script element found";
>
> Can a similar expression that avoids an intermediate array variable be
> written in Perl 6?
>



-- 
Will "Coke" Coleda


Perl 5 list assignment idiom

2017-03-13 Thread Sean McAfee
In Perl 5, list assignment in scalar context evaluates to the number of
list elements on the right-hand side.  That enables an idiom that I rather
like:

1 == (my ($script) = $page->find('//script'))
  or die "Other than exactly one script element found";

Can a similar expression that avoids an intermediate array variable be
written in Perl 6?


Re: perl 5?

2016-11-17 Thread ToddAndMargo

  
  
On 11/17/2016 05:34 AM, yary wrote:


  
Addning to Jan's answer,
PerlMonks is still a great place for answers on Perl5
  topics (and even some Perl6) http://perlmonks.org/




> I still do not have perl 6 support on rhel 7.2



Don't know how much of an "early
  adopter" you want to be- if that's an option, try building
  Rakudo from source, so you're not waiting on a package- http://rakudo.org/how-to-get-rakudo/#Installing-Rakudo-Star-Linux

  
-y

  
  

  


I do this with Wine-staging.  But it iwas a pain in the neck to
clear out all the stuff from the RPM.  

I wonder how much damage directly installing would cause when
the rpm finally comes out.  Different paths an all.  Mixed versions,
etc..
-- 
~~
Computers are like air conditioners.
They malfunction when you open windows
~~
  




Re: perl 5?

2016-11-17 Thread Brandon Allbery
On Thu, Nov 17, 2016 at 3:03 PM, ToddAndMargo <toddandma...@zoho.com> wrote:

> And quiet a few perl 5 programmers are REALLY GRUMPY/CRABBY
> about perl 6.  I don't get it.
>

I think mostly this is history: the original perl 6 development team
languished for many years producing basically nothing while promising
everything and promising it "soon". This has rather strongly colored all
subsequent interactions.

-- 
brandon s allbery kf8nh   sine nomine associates
allber...@gmail.com  ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net


Re: perl 5?

2016-11-17 Thread ToddAndMargo

  
  
On 11/17/2016 08:18 AM, Brandon Allbery
  wrote:


  

  On Thu, Nov 17, 2016 at 2:08 AM,
ToddAndMargo <toddandma...@zoho.com>
wrote:
Would
  you guys tolerate a perl 5 question every so often?
  
  
  Quite a few of the folks who work on Perl 6 don't know Perl 5,
  or at least know it only incidentally.
  
  
  -- 
  

  brandon s allbery kf8nh                              
sine nomine associates
  allber...@gmail.com
                                 ballb...@sinenomine.net
  unix, openafs, kerberos, infrastructure, xmonad      
 http://sinenomine.net

  

  



And quiet a few perl 5 programmers are REALLY GRUMPY/CRABBY
about perl 6.  I don't get it.  From what I have seen, perl 6
removes
some of the poorly thought out features with perl 5, such
as having to pass address pointers (references) of arrays to
subroutines when passing multiple variables with arrays in them.  

I can't wait for RHEL 7 support for perl 6.


-- 
~~
Computers are like air conditioners.
They malfunction when you open windows
~~
  




Re: perl 5?

2016-11-17 Thread ToddAndMargo

  
  
On 11/16/2016 11:27 PM, Jan Ingvoldstad
  wrote:


  

  On Thu, Nov 17, 2016 at 8:08 AM,
ToddAndMargo <toddandma...@zoho.com>
wrote:
Hi All,
  
  Would you guys tolerate a perl 5 question every so often?
  

  
  
  
  Perl 5 questions that relate to Perl 6 would probably be on
  topic.


If what you want is help with Perl 5
  for Perl 5's sake, though, I humbly suggest that using one of
  the Perl 5 mailing lists, or IRC channels, may be more useful
  to you.


See here for more information:


https://lists.perl.org/



http://www.irc.perl.org/channels.html


  
  
  You may also find one of your local Perl communities
helpful, see here for more info about that:
  
  
  https://www.perl.org/community.html
  
  -- 
  Jan

  


And there is always perl monks, but their site 
required you hand code in html and has a really bizarre
thread mechanism.  But they can be very helpful at times too.

-- 
~~
Computers are like air conditioners.
They malfunction when you open windows
~~
  




Re: perl 5?

2016-11-17 Thread Brandon Allbery
On Thu, Nov 17, 2016 at 2:08 AM, ToddAndMargo <toddandma...@zoho.com> wrote:

> Would you guys tolerate a perl 5 question every so often?


Quite a few of the folks who work on Perl 6 don't know Perl 5, or at least
know it only incidentally.

-- 
brandon s allbery kf8nh   sine nomine associates
allber...@gmail.com  ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net


Re: perl 5?

2016-11-17 Thread yary
Addning to Jan's answer,
PerlMonks is still a great place for answers on Perl5 topics (and even some
Perl6) http://perlmonks.org/


> I still do not have perl 6 support on rhel 7.2

Don't know how much of an "early adopter" you want to be- if that's
an option, try building Rakudo from source, so you're not waiting on a
package- http://rakudo.org/how-to-get-rakudo/#Installing-Rakudo-Star-Linux

-y


Re: perl 5?

2016-11-16 Thread Jan Ingvoldstad
On Thu, Nov 17, 2016 at 8:08 AM, ToddAndMargo <toddandma...@zoho.com> wrote:

> Hi All,
>
> Would you guys tolerate a perl 5 question every so often?
>
>
Perl 5 questions that relate to Perl 6 would probably be on topic.

If what you want is help with Perl 5 for Perl 5's sake, though, I humbly
suggest that using one of the Perl 5 mailing lists, or IRC channels, may be
more useful to you.

See here for more information:

https://lists.perl.org/

http://www.irc.perl.org/channels.html

You may also find one of your local Perl communities helpful, see here for
more info about that:

https://www.perl.org/community.html
-- 
Jan


perl 5?

2016-11-16 Thread ToddAndMargo

Hi All,

Would you guys tolerate a perl 5 question every so often?

-T

I still do not have perl 6 support on rhel 7.2

--
~~
Computers are like air conditioners.
They malfunction when you open windows
~~




Re: rakudo bug 128427 perl 5 does not build on Darwin platforms with clock_gettime

2016-11-15 Thread Andy Bach
>> so I copied
git_reference/MoarVM/src/platform/posix/time.c

>> to
moar-nom/nqp/MoarVM/src/platform/posix/time.c

>> and now it builds.

On Tue, Nov 15, 2016 at 12:15 PM, Tobias Leich  wrote:

> Hi, if you let raukdo automatically rebuild nqp/moar, then you still were
> on an old revision of moarvm.
> This revision did not contain the latest patch.
>
Yeah, that's why I tried nuking it.  I'd noticed just re-running rakudobrew
build moar did check the repository but didn't rebuild.

> Please rebuild now, as I've updated the git revisions, so latest nqp and
> moarvm get build.
>
Thanks! I'll try at home tonight. I didn't see a "rakudobrew clean" option
- I first tried deleting (after the copy) the
moar-nom/nqp/MoarVM/src/platform/posix/time.o
hoping make would see it missing and rebuild. I then deleted the
install/bin/moar (noticing it was saying "found a install/bin/moar version
xx, using that) and re-re-ran rakudobuild and that one worked.


-- 

a

Andy Bach,
afb...@gmail.com
608 658-1890 cell
608 261-5738 wk


Re: rakudo bug 128427 perl 5 does not build on Darwin platforms with clock_gettime

2016-11-15 Thread Tobias Leich
Hi, if you let raukdo automatically rebuild nqp/moar, then you still 
were on an old revision of moarvm.

This revision did not contain the latest patch.

Please rebuild now, as I've updated the git revisions, so latest nqp and 
moarvm get build.


Am 15.11.2016 um 18:14 schrieb Brandon Allbery:


On Tue, Nov 15, 2016 at 8:53 AM, Andy Bach > wrote:


Well, I just nuked and built moar-nom here OSX 10.11.6/Xcode 8


This is not a MoarVM problem; it's a bug in the Xcode 8 (and 8.1) 
Command Line Tools and documented (poorly) in the Xcode 8 release 
notes. You must download the Xcode 7 Command Line Tools for 10.11 
(https://developer.apple.com/download/ need Apple ID, do *not* need a 
developer account!) and install them over the Xcode 8 Command Line Tools.


(Short version: the Xcode 8 Command Line Tools, including libraries, 
are for 10.12 only. 10.11 does not have clock_gettime, because it was 
added in 10.12. So all compile time testing finds it via CLT libs, but 
runtime won't find it because that lib comes from the OS install 
instead of Xcode.)


--
brandon s allbery kf8nh sine nomine associates
allber...@gmail.com  
ballb...@sinenomine.net 

unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net




Re: rakudo bug 128427 perl 5 does not build on Darwin platforms with clock_gettime

2016-11-15 Thread Brandon Allbery
On Tue, Nov 15, 2016 at 8:53 AM, Andy Bach  wrote:
>
> Well, I just nuked and built moar-nom here OSX 10.11.6/Xcode 8
>

This is not a MoarVM problem; it's a bug in the Xcode 8 (and 8.1) Command
Line Tools and documented (poorly) in the Xcode 8 release notes. You must
download the Xcode 7 Command Line Tools for 10.11 (
https://developer.apple.com/download/ need Apple ID, do *not* need a
developer account!) and install them over the Xcode 8 Command Line Tools.

(Short version: the Xcode 8 Command Line Tools, including libraries, are
for 10.12 only. 10.11 does not have clock_gettime, because it was added in
10.12. So all compile time testing finds it via CLT libs, but runtime won't
find it because that lib comes from the OS install instead of Xcode.)

-- 
brandon s allbery kf8nh   sine nomine associates
allber...@gmail.com  ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net


Re: rakudo bug 128427 perl 5 does not build on Darwin platforms with clock_gettime

2016-11-15 Thread Andy Bach
oar-nom/nqp/MoarVM/src/platform/posix/time.c

On Tue, Nov 15, 2016 at 6:23 AM,  wrote:

> Hi, we addressed it here


Well, I just nuked and built moar-nom here OSX 10.11.6/Xcode 8
15.6.0 Darwin Kernel Version 15.6.0: Wed Nov  2 20:30:56 PDT 2016;
root:xnu-3248.60.11.1.2~2/RELEASE_X86_64 x86_64

and:
moar-nom/nqp/MoarVM/src/platform/posix/time.c

is still the same and the build fails [1]. so I copied
git_reference/MoarVM/src/platform/posix/time.c

to
moar-nom/nqp/MoarVM/src/platform/posix/time.c

and now it builds.  I see about 12-15 warnings but ...

[1]
Configuring native build environment ... OK
probing whether your compiler thinks that it is gcc  YES
probing how your compiler does static inline ... static __inline__
your CPU can read unaligned values for all of int32 int64 num64
probing the size of pointers ... 8
probing C type support for: _Bool, bool  YES: _Bool,bool
probing computed goto support .. YES
probing pthread_yield support .. NO

make: make
 compile: clang -fno-omit-frame-pointer -fno-optimize-sibling-calls -O3
-DNDEBUG -Wno-logical-op-parentheses -D_DARWIN_USE_64_BIT_INODE=1
includes:  -I3rdparty/libuv/include -I3rdparty/libuv/src
-I3rdparty/libatomic_ops/src -I3rdparty/libtommath -I3rdparty/dynasm
-I3rdparty/dyncall/dynload -I3rdparty/dyncall/dyncall
-I3rdparty/dyncall/dyncallback
link: clang  -O3 -DNDEBUG -Wl,-rpath,"/@libdir@"
-Wl,-rpath,"@prefix@/share/perl6/site/lib"
libs: -lpthread

  byte order: little endian

...

/usr/local/bin/perl -MExtUtils::Command -e cp
3rdparty/dyncall/dyncallback/*.h
/Users/afbach/.rakudobrew/moar-nom/install/include/dyncall
dyld: lazy symbol binding failed: Symbol not found: _clock_gettime
  Referenced from:
/Users/afbach/.rakudobrew/moar-nom/install/lib/libmoar.dylib (which was
built for Mac OS X 10.12)
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _clock_gettime
  Referenced from:
/Users/afbach/.rakudobrew/moar-nom/install/lib/libmoar.dylib (which was
built for Mac OS X 10.12)
  Expected in: /usr/lib/libSystem.B.dylib

Cleaning up ...
/usr/local/bin/perl -MExtUtils::Command -e mkpath gen/moar/stage1/gen
/usr/local/bin/perl tools/build/gen-cat.pl moar src/how/Archetypes.nqp
src/how/RoleToRoleApplier.nqp src/how/NQPConcreteRoleHOW.nqp
src/how/RoleToClassApplier.nqp src/how/NQPCurriedRoleHOW.nqp
src/how/NQPParametricRoleHOW.nqp src/how/NQPClassHOW.nqp
src/how/NQPNativeHOW.nqp src/how/NQPAttribute.nqp src/how/NQPModuleHOW.nqp
src/how/EXPORTHOW.nqp  > gen/moar/stage1/nqpmo.nqp
/Users/afbach/.rakudobrew/moar-nom/install/bin/moar
--libpath=src/vm/moar/stage0 src/vm/moar/stage0/nqp.moarvm --bootstrap
--setting=NULL --no-regex-lib --target=mbc \
--output=gen/moar/stage1/nqpmo.moarvm gen/moar/stage1/nqpmo.nqp
dyld: lazy symbol binding failed: Symbol not found: _clock_gettime
  Referenced from:
/Users/afbach/.rakudobrew/moar-nom/install/lib/libmoar.dylib (which was
built for Mac OS X 10.12)
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _clock_gettime
  Referenced from:
/Users/afbach/.rakudobrew/moar-nom/install/lib/libmoar.dylib (which was
built for Mac OS X 10.12)
  Expected in: /usr/lib/libSystem.B.dylib

make: *** [gen/moar/stage1/nqpmo.moarvm] Trace/BPT trap: 5
Command failed (status 512): make
Command failed (status 512): /usr/local/bin/perl Configure.pl
--prefix=/Users/afbach/.rakudobrew/moar-nom/install --backends=moar
--make-install --git-protocol=https
--git-reference=/Users/afbach/.rakudobrew/bin/../git_reference --gen-moar
Failed running /usr/local/bin/perl Configure.pl --backends=moar --gen-moar
--git-reference="/Users/afbach/.rakudobrew/bin/../git_reference"
--make-install  at /Users/afbach/.rakudobrew/bin/rakudobrew line 58.
main::run("/usr/local/bin/perl Configure.pl --backends=moar --gen-moar
-"...) called at /Users/afbach/.rakudobrew/bin/rakudobrew line 386
main::build_impl("moar", undef, "") called at
/Users/afbach/.rakudobrew/bin/rakudobrew line 116



-- 

a

Andy Bach,
afb...@gmail.com
608 658-1890 cell
608 261-5738 wk


Re: rakudo bug 128427 perl 5 does not build on Darwin platforms with clock_gettime

2016-11-15 Thread email
Hi, we adressed it here:  
https://github.com/MoarVM/MoarVM/commit/20c8591ad7644926e09691da8c2a9179b11ac53e


Zitat von Andy Bach :


Hi,

Turns out this bug was filed for p5 (I thought I was looking at the p6 bug
list) but I saw this exactly today, trying to build, via rakudobrew, on my
mac book. Just checking if this is a known thing or not.

--

a

Andy Bach,
afb...@gmail.com
608 658-1890 cell
608 261-5738 wk






rakudo bug 128427 perl 5 does not build on Darwin platforms with clock_gettime

2016-11-14 Thread Andy Bach
Hi,

Turns out this bug was filed for p5 (I thought I was looking at the p6 bug
list) but I saw this exactly today, trying to build, via rakudobrew, on my
mac book. Just checking if this is a known thing or not.

-- 

a

Andy Bach,
afb...@gmail.com
608 658-1890 cell
608 261-5738 wk


Re: [BUG] Perl 6 text file line read is much slower than Perl 5

2016-10-22 Thread Tom Browder
On Saturday, October 22, 2016, Elizabeth Mattijsen via RT <
perl6-bugs-follo...@perl.org> wrote:

> Would you believe it used to be a lot slower still?
>
> Anyways, what does P6/P5 mean??   If it’s the runtimes divided, I get
> values between 9 and 10 or so.  Which would be less surprising to me.


It is actually process user time ratios and I have cleaned up the log file
format a bit to show that better. I have tried to eliminate any elapsed
time stats.

I'll update the times shown on the readme when I finish the cleanup.


Re: [perl #129941] [BUG] Perl 6 text file line read is much slower than Perl 5

2016-10-22 Thread Elizabeth Mattijsen
Would you believe it used to be a lot slower still?

Anyways, what does P6/P5 mean??   If it’s the runtimes divided, I get values 
between 9 and 10 or so.  Which would be less surprising to me.


> On 22 Oct 2016, at 13:24, Tom Browder (via RT) <perl6-bugs-follo...@perl.org> 
> wrote:
> 
> # New Ticket Created by  Tom Browder 
> # Please include the string:  [perl #129941]
> # in the subject line of all future correspondence about this issue. 
> # https://rt.perl.org/Ticket/Display.html?id=129941 >
> 
> 
> See <https://github.com/tbrowder/perl6-read-write-tests> for a suite
> of tests that show the differences.
> 
> For example (from the link above):
> 
> Results of recent file read tests
> 
> Date  | Rakudo Version  | File Size (lines)   | Perl 5
> RT | Perl 6 RT   | P6/P5
> ==
> 2016-10-18 | 2016.10-16-geb6907e |   1_000_000|  1.39s   |
>12.61s  |  25.2
> 2016-10-18 | 2016.10-16-geb6907e |   6_000_000_000 |75.47s   |
> 737.63s  |  18.2
> 2016-10-18 | 2016.10-16-geb6907e | 10_000_000_000 |   121.33s   |
> 1233.29s  |  25.1
> 
> Notes:
> 
> RT - run time



[perl #129941] [BUG] Perl 6 text file line read is much slower than Perl 5

2016-10-22 Thread via RT
# New Ticket Created by  Tom Browder 
# Please include the string:  [perl #129941]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/Ticket/Display.html?id=129941 >


See <https://github.com/tbrowder/perl6-read-write-tests> for a suite
of tests that show the differences.

For example (from the link above):

Results of recent file read tests

Date  | Rakudo Version  | File Size (lines)   | Perl 5
RT | Perl 6 RT   | P6/P5
==
2016-10-18 | 2016.10-16-geb6907e |   1_000_000|  1.39s   |
12.61s  |  25.2
2016-10-18 | 2016.10-16-geb6907e |   6_000_000_000 |75.47s   |
737.63s  |  18.2
2016-10-18 | 2016.10-16-geb6907e | 10_000_000_000 |   121.33s   |
1233.29s  |  25.1

Notes:

RT - run time


Re: is there a Perl 5 converter?

2016-01-21 Thread Steve Mynott
On 21 January 2016 at 01:40, Darren Duncan <dar...@darrenduncan.net> wrote:
> On 2016-01-20 5:02 PM, ToddAndMargo wrote:
>>
>> or is it all by hand?
>
>
> If you mean a source code translator, I don't know of one right now but I
> wouldn't be surprised if one exists, that at least handles a common subset
> of Perl 5 code.  I expect having one will be a priority if it isn't around
> now.

There are at least two source code translators in progress:

http://search.cpan.org/dist/Perl-ToPerl6/

https://github.com/Util/Blue_Tiger/

They probably help but I'd be surprised if they work particularly well
yet in producing code which runs straight off.

-- 
4096R/EA75174B Steve Mynott <steve.myn...@gmail.com>


Re: is there a Perl 5 converter?

2016-01-21 Thread Bruce Gray

On Jan 21, 2016, at 2:36 AM, Steve Mynott <steve.myn...@gmail.com> wrote:

> On 21 January 2016 at 01:40, Darren Duncan <dar...@darrenduncan.net> wrote:
>> On 2016-01-20 5:02 PM, ToddAndMargo wrote:
>>> 
>>> or is it all by hand?
>> 
>> 
>> If you mean a source code translator, I don't know of one right now but I
>> wouldn't be surprised if one exists, that at least handles a common subset
>> of Perl 5 code.  I expect having one will be a priority if it isn't around
>> now.
> 
> There are at least two source code translators in progress:
> 
> http://search.cpan.org/dist/Perl-ToPerl6/
> 
> https://github.com/Util/Blue_Tiger/
> 
> They probably help but I'd be surprised if they work particularly well
> yet in producing code which runs straight off.

I am the author of one of the translators (Blue Tiger),
and I welcome feedback on which parts are missing that
would (be|have been) useful to you; it will help me prioritize development.

For automated translation, see 
http://docs.perl6.org/language/5to6-nutshell#Automated_Translation
   Blue Tiger (p526) and Perl-ToPerl6 (perlmogrify) are the most useable.
   Perlito's website is down.

( For manual translation, read all of the 5to6-* docs at the top of 
http://docs.perl6.org/language.html , or email me ).

Below, I have a terminal log of installation and execution of both translators.

$ cat >example.pl < $c {
   "$c$c$c\n".print();
}

$ git clone git://github.com/Util/Blue_Tiger.git
$ cd Blue_Tiger
$ bin/p526 ../example.pl


my @aaa = < a b c d e f g >;

for @aaa <-> $c {
   print "$c$c$c\n";
}


-- 
Hope this helps,
Bruce Gray (Util on IRC)




Re: is there a Perl 5 converter?

2016-01-21 Thread Tom Browder
On Thursday, January 21, 2016, Bruce Gray <bruce.g...@acm.org> wrote:
> On Jan 21, 2016, at 2:36 AM, Steve Mynott <steve.myn...@gmail.com> wrote:
> > On 21 January 2016 at 01:40, Darren Duncan <dar...@darrenduncan.net> wrote:
> >> On 2016-01-20 5:02 PM, ToddAndMargo wrote:
> > There are at least two source code translators in progress:
> > http://search.cpan.org/dist/Perl-ToPerl6/
> > https://github.com/Util/Blue_Tiger/
...
> I am the author of one of the translators (Blue Tiger),
> and I welcome feedback on which parts are missing that
> would (be|have been) useful to you; it will help me prioritize development.
>
> For automated translation, see 
> http://docs.perl6.org/language/5to6-nutshell#Automated_Translation
>Blue Tiger (p526) and Perl-ToPerl6 (perlmogrify) are the most useable.
>Perlito's website is down.
>
> ( For manual translation, read all of the 5to6-* docs at the top of 
> http://docs.perl6.org/language.html , or email me ).
>
> Below, I have a terminal log of installation and execution of both 
> translators.
..

Perl 5 source
==
> my @aaa = qw( a b c d e f g );
> for my $c (@aaa) {

Perl::ToPerl6
=
> my @aaa = qw ( a b c d e f g );
> for (@aaa) -> $c {

Blue_Tiger

> my @aaa = < a b c d e f g >;
> for @aaa <-> $c {

For the example Perl 5 input I like the Blue_Tiger translation, except
I haven't so far found an description of the '<->' operator.  Why
would Blue_Tiger prefer it to the '->' operator which I've seen in all
the examples I can remember seeing?

Thanks.

Cheers!

-Tom


Re: is there a Perl 5 converter?

2016-01-21 Thread Aaron Baugher
Tom Browder <tom.brow...@gmail.com> writes:

> Perl 5 source
> ==
>> my @aaa = qw( a b c d e f g );
>> for my $c (@aaa) {
>
> Perl::ToPerl6
> =
>> my @aaa = qw ( a b c d e f g );
>> for (@aaa) -> $c {
>
> Blue_Tiger
> 
>> my @aaa = < a b c d e f g >;
>> for @aaa <-> $c {
>
> For the example Perl 5 input I like the Blue_Tiger translation, except
> I haven't so far found an description of the '<->' operator.  Why
> would Blue_Tiger prefer it to the '->' operator which I've seen in all
> the examples I can remember seeing?

In Perl 5, the loop variable ($c) is an alias into the array, and changing its 
value changes the the value in the array.  In Perl 6, the array being worked on 
is read-only by default, so in the Perl::ToPerl6 example, trying to change the 
value of $c inside the loop would throw an error.  Using the <-> operator (also 
pointing back from the loop variable to the array) tells it to use the Perl 5 
behavior, where the array can be changed by changing the loop variable.


-- 
Aaron -- aaron.baugher.biz


Re: is there a Perl 5 converter?

2016-01-21 Thread Tom Browder
On Thu, Jan 21, 2016 at 12:00 PM, Aaron Baugher <aa...@baugher.biz> wrote:
> Tom Browder <tom.brow...@gmail.com> writes:
...
>> For the example Perl 5 input I like the Blue_Tiger translation, except
>> I haven't so far found an description of the '<->' operator.  Why
>> would Blue_Tiger prefer it to the '->' operator which I've seen in all
>> the examples I can remember seeing?
>
> In Perl 5, the loop variable ($c) is an alias into the array, and changing 
> its value changes the the value in the array.  In Perl 6, the array being 
> worked on is read-only by default, so in the Perl::ToPerl6 example, trying to 
> change the value of $c inside the loop would throw an error.  Using the <-> 
> operator (also pointing back from the loop variable to the array) tells it to 
> use the Perl 5 behavior, where the array can be changed by changing the loop 
> variable.

Thanks, Aaron, good explanation.  But can you find a description of
'<->' in the Perl 6 docs?

I did a search here

  
https://raw.githubusercontent.com/perl6/mu/master/docs/Perl6/Cheatsheet/cheatsheet.txt

here

  https://doc.perl6.org/language/operators

and here:

  https://doc.perl6.org/language.html

and couldn't find it.

Cheers!

-Tom


Re: is there a Perl 5 converter?

2016-01-21 Thread Aaron Baugher
Tom Browder  writes:

> Thanks, Aaron, good explanation.  But can you find a description of
> '<->' in the Perl 6 docs?

It's mentioned here: https://doc.perl6.org/language/control#for

And here, where it's called the "double-ended arrow", though I don't know how
official that name is: https://design.perl6.org/S04.html#The_for_statement

I don't know if it's actually an operator, which may be why it's hard to find.


-- 
Aaron -- aaron.baugher.biz


Re: is there a Perl 5 converter?

2016-01-21 Thread Patrick R. Michaud
On Thu, Jan 21, 2016 at 01:39:15PM -0600, Aaron Baugher wrote:
> Tom Browder  writes:
> 
> > Thanks, Aaron, good explanation.  But can you find a description of
> > '<->' in the Perl 6 docs?
> 
> It's mentioned here: https://doc.perl6.org/language/control#for
> 
> And here, where it's called the "double-ended arrow", though I don't know how
> official that name is: https://design.perl6.org/S04.html#The_for_statement
> 
> I don't know if it's actually an operator, which may be why it's hard to find.

'<->' isn't an operator, it's one of the tokens that introduces a pointy block 
term.  It's the "default to rw" form of '->' for declaring a block with 
parameters.

Pm


Re: is there a Perl 5 converter?

2016-01-21 Thread Tom Browder
On Thu, Jan 21, 2016 at 1:39 PM, Aaron Baugher  wrote:
> Tom Browder  writes:
>
>> Thanks, Aaron, good explanation.  But can you find a description of
>> '<->' in the Perl 6 docs?
>
> It's mentioned here: https://doc.perl6.org/language/control#for
...
> I don't know if it's actually an operator, which may be why it's hard to find.

Thanks, Aaron!

-Tom


Re: is there a Perl 5 converter?

2016-01-20 Thread Darren Duncan

On 2016-01-20 5:02 PM, ToddAndMargo wrote:

or is it all by hand?


If you mean a source code translator, I don't know of one right now but I 
wouldn't be surprised if one exists, that at least handles a common subset of 
Perl 5 code.  I expect having one will be a priority if it isn't around now.


Maybe around 5 years ago I recall that the Perl 5 interpreter was updated to 
retain all source metadata in its parse tree partly so that this could be a 
basis to generate the original Perl 5 source, or alternately generate 
corresponding Perl 6 from it.  See also the CPAN module PPI which may be a basis 
for one.


You may not need a source translator though.

The Perl 6 module Inline::Perl5 lets you simply use Perl 5 modules in Perl 6 
programs as if they were Perl 6 modules.


The source translation I'm aware of is generally by hand, and often people doing 
it are also doing significant rewrites to take better advantage of the new Perl 
6 features and idioms that a more mechanical automatic translation wouldn't.


Did that tell you anything useful?

-- Darren Duncan



is there a Perl 5 converter?

2016-01-20 Thread ToddAndMargo

or is it all by hand?

--
~~
Computers are like air conditioners.
They malfunction when you open windows
~~



Re: Workaround for Perl 5's __DATA__

2016-01-18 Thread Tom Browder
On Mon, Jan 18, 2016 at 6:47 AM, Kamil Kułaga  wrote:
> You may be happy with =finish block
...

Thanks, Kamil!

-Tom


Re: Workaround for Perl 5's __DATA__

2016-01-18 Thread Kamil Kułaga
You may be happy with =finish block

use v6;

say $=finish.split("\n").perl;


=finish
_
I like pancakes
And apples

On Sat, Jan 16, 2016 at 8:07 PM, Tom Browder  wrote:
> I have tried this in my Perl 6 code (v6.c):
>
> =begin DATA
> blah
> blah2
> =end DATA
>
> Then:
>
> for $=DATA.lines -> $line {
>   # process a line
> }
>
> but I get this message:
>
> Pod variable @=DATA not yet implemented. Sorry.
>
> Is there any workaround for this other than putting the data in an array?
>
> Thanks.
>
> Best regards,
>
> -Tom



-- 
Pozdrawiam

Kamil Kułaga


Workaround for Perl 5's __DATA__

2016-01-16 Thread Tom Browder
I have tried this in my Perl 6 code (v6.c):

=begin DATA
blah
blah2
=end DATA

Then:

for $=DATA.lines -> $line {
  # process a line
}

but I get this message:

Pod variable @=DATA not yet implemented. Sorry.

Is there any workaround for this other than putting the data in an array?

Thanks.

Best regards,

-Tom


Re: What are Perl 6's killer advantages over Perl 5?

2015-09-03 Thread Jan Ingvoldstad
On Wed, Sep 2, 2015 at 3:51 AM, Robert Strahl via perl6-users <
perl6-us...@perl.org> wrote:

> I don't understand why some people feel so strongly that one-liners should
> be strict. That would undermine what a one-liner is — a quick way to get
> something done. I use perl5 one-liners very frequently for text processing,
> especially when stringing / piping together shell code. When I need to
> re-use the code, then I put it into a script and make it strict and
> bulletproof in other ways. Declaring variables in the one-liner context
> makes no sense.
>
> Since the two sides of this debate will never see eye-to-eye on this, all
> I can ask is that there be an easy and top-level way to set the default
> strict or not_strict for one-liners. Perhaps a shell variable
> PERL6-ONE-LINERS-STRICT=<0|1>; , or -e -E as mentioned.
>

First, my apologies for not getting involved earlier, this discussion flew
below my radar.

I'm completely in agreement with your arguments, Robert, I don't see the
use for requiring strict for the command line by default.

Strict mode cripples Perl 6's usability for one-off scripts*.

Specifying -Mstrict or -e 'use strict;' is good enough for those cases when
you really need to be strict in one-off scripts.

Specifying -E instead of -e to do the same seems a good way to confuse
people, considering the apparent similarity to the Perl 5 options. There
are only so many context switches a human brain can handle.

* I don't like calling them one-liners, as they can be quite complex before
evolving into file-based scripts.

-- 
Jan


Re: What are Perl 6's killer advantages over Perl 5?

2015-09-03 Thread Matija Papec


02.09.2015, 16:42, "Robert Strahl via perl6-users" :
>  I don't understand why some people feel so strongly that one-liners should 
> be strict. That would undermine what a one-liner is — a quick way to get 
> something done. I use perl5 one-liners very frequently for text processing, 
> especially when stringing / piping together shell code. When I need to re-use 
> the code, then I put it into a script and make it strict and bulletproof in 
> other ways. Declaring variables in the one-liner context makes no sense.

I agree, and these are all valid con arguments, but so far I did not have a 
opportunity to hear any arguments for opposite.



Re: What are Perl 6's killer advantages over Perl 5?

2015-09-02 Thread Robert Strahl via perl6-users
I don't understand why some people feel so strongly that one-liners should
be strict. That would undermine what a one-liner is — a quick way to get
something done. I use perl5 one-liners very frequently for text processing,
especially when stringing / piping together shell code. When I need to
re-use the code, then I put it into a script and make it strict and
bulletproof in other ways. Declaring variables in the one-liner context
makes no sense.

Since the two sides of this debate will never see eye-to-eye on this, all I
can ask is that there be an easy and top-level way to set the default
strict or not_strict for one-liners. Perhaps a shell variable
PERL6-ONE-LINERS-STRICT=<0|1>; , or -e -E as mentioned.


On Tue, Sep 1, 2015 at 1:24 AM, Matija Papec <mpapec2...@yandex.com> wrote:

> This is actually bad decision. If I'm concerned with *my* one-liner I'll
> use -Mstrict and all would be great.
> On the other hand, most of the time one-liners use one or two variables.
> Now, how difficult is for human to track these two?
>
> ps. -M-strict (no strict) is not valid command line option, so perl6 -e
> 'no strict; ..' is to my knowledge only option to disable it.
>
>
>
> 28.08.2015, 17:48, "Carl Mäsak" <cma...@gmail.com>:
> > Moritz (>>), Tux (>):
> >>>  I could continue with other Perl 5 deficiencies (no strict by default,
> >>
> >>  Using strict *STILL* is not enabled by default for perl6
> >>  one-liners either:
> >>
> >>  $ perl6 -e'my Int $this = 1; $thıs++; say $this;'
> >>  1
> >>  $ perl6 -Mstrict -e'my Int $this = 1; $thıs++; say $this;'
> >>  ===SORRY!=== Error while compiling -e
> >>  Variable '$thıs' is not declared. Did you mean '$this'?
> >>  at -e:1
> >>  --> my Int $this = 1; ⏏$thıs++; say $this;
> >>
> >>  That, IMHO, is a huge deficiency!
> >>
> >>>  lack of easy threading, too many globals, obscure regex syntax), but
> the
> >>>  individual problems aren't the point. My main point is that large
> parts
> >>>  of Perl 5 are still stuck in the past, with no good way forward.
> >
> > Good news! I just pushed a change (with backing from other core
> > developers) that makes -e strict by default!
> >
> > commit 5fb81fffa90f90515e663a21987cff484e8260b8
> > Author: Carl Masak <cma...@gmail.com>
> > Date: Fri Aug 28 17:45:25 2015 +0200
> >
> > strict is now on by default, even for -e
> >
> > This should make (most of) p6u happy.
> >
> > Enjoy! :)
> >
> > // Carl
>


Re: What are Perl 6's killer advantages over Perl 5?

2015-09-01 Thread Matija Papec
This is actually bad decision. If I'm concerned with *my* one-liner I'll use 
-Mstrict and all would be great.
On the other hand, most of the time one-liners use one or two variables. Now, 
how difficult is for human to track these two?

ps. -M-strict (no strict) is not valid command line option, so perl6 -e 'no 
strict; ..' is to my knowledge only option to disable it.



28.08.2015, 17:48, "Carl Mäsak" <cma...@gmail.com>:
> Moritz (>>), Tux (>):
>>>  I could continue with other Perl 5 deficiencies (no strict by default,
>>
>>  Using strict *STILL* is not enabled by default for perl6
>>  one-liners either:
>>
>>  $ perl6 -e'my Int $this = 1; $thıs++; say $this;'
>>  1
>>  $ perl6 -Mstrict -e'my Int $this = 1; $thıs++; say $this;'
>>  ===SORRY!=== Error while compiling -e
>>  Variable '$thıs' is not declared. Did you mean '$this'?
>>  at -e:1
>>  --> my Int $this = 1; ⏏$thıs++; say $this;
>>
>>  That, IMHO, is a huge deficiency!
>>
>>>  lack of easy threading, too many globals, obscure regex syntax), but the
>>>  individual problems aren't the point. My main point is that large parts
>>>  of Perl 5 are still stuck in the past, with no good way forward.
>
> Good news! I just pushed a change (with backing from other core
> developers) that makes -e strict by default!
>
> commit 5fb81fffa90f90515e663a21987cff484e8260b8
> Author: Carl Masak <cma...@gmail.com>
> Date: Fri Aug 28 17:45:25 2015 +0200
>
> strict is now on by default, even for -e
>
> This should make (most of) p6u happy.
>
> Enjoy! :)
>
> // Carl


Re: What are Perl 6's killer advantages over Perl 5?

2015-08-31 Thread Marc Chantreux
On Fri, Aug 28, 2015 at 05:48:07PM +0200, Carl Mäsak wrote:
> Good news! I just pushed a change (with backing from other core
> developers) that makes -e strict by default! 

awesome! thank you Carl! 

-- 
Marc Chantreux (eiro on github and freenode)
http://eiro.github.com/
http://eiro.github.com/atom.xml
"Don't believe everything you read on the Internet"
-- Abraham Lincoln


Re: What are Perl 6's killer advantages over Perl 5?

2015-08-28 Thread Carl Mäsak
Moritz (), Tux ():
 I could continue with other Perl 5 deficiencies (no strict by default,

 Using strict *STILL* is not enabled by default for perl6
 one-liners either:

 $ perl6 -e'my Int $this = 1; $thıs++; say $this;'
 1
 $ perl6 -Mstrict -e'my Int $this = 1; $thıs++; say $this;'
 ===SORRY!=== Error while compiling -e
 Variable '$thıs' is not declared. Did you mean '$this'?
 at -e:1
 -- my Int $this = 1; ⏏$thıs++; say $this;

 That, IMHO, is a huge deficiency!

 lack of easy threading, too many globals, obscure regex syntax), but the
 individual problems aren't the point. My main point is that large parts
 of Perl 5 are still stuck in the past, with no good way forward.

Good news! I just pushed a change (with backing from other core
developers) that makes -e strict by default!

commit 5fb81fffa90f90515e663a21987cff484e8260b8
Author: Carl Masak cma...@gmail.com
Date:   Fri Aug 28 17:45:25 2015 +0200

strict is now on by default, even for -e

This should make (most of) p6u happy.

Enjoy! :)

// Carl


Re: What are Perl 6's killer advantages over Perl 5?

2015-08-28 Thread yary
Oh dear... can we get non-strict for one liners with -E then? I admit it
isn't an issue for me at the moment, as I do my one liners in perl5
currently

Maybe I need to think functionally, so variable declaration isn't an issue
at all

-y

On Fri, Aug 28, 2015 at 11:48 AM, Carl Mäsak cma...@gmail.com wrote:

 Moritz (), Tux ():
  I could continue with other Perl 5 deficiencies (no strict by default,
 
  Using strict *STILL* is not enabled by default for perl6
  one-liners either:
 
  $ perl6 -e'my Int $this = 1; $thıs++; say $this;'
  1
  $ perl6 -Mstrict -e'my Int $this = 1; $thıs++; say $this;'
  ===SORRY!=== Error while compiling -e
  Variable '$thıs' is not declared. Did you mean '$this'?
  at -e:1
  -- my Int $this = 1; ⏏$thıs++; say $this;
 
  That, IMHO, is a huge deficiency!
 
  lack of easy threading, too many globals, obscure regex syntax), but the
  individual problems aren't the point. My main point is that large parts
  of Perl 5 are still stuck in the past, with no good way forward.

 Good news! I just pushed a change (with backing from other core
 developers) that makes -e strict by default!

 commit 5fb81fffa90f90515e663a21987cff484e8260b8
 Author: Carl Masak cma...@gmail.com
 Date:   Fri Aug 28 17:45:25 2015 +0200

 strict is now on by default, even for -e

 This should make (most of) p6u happy.

 Enjoy! :)

 // Carl



Re: What are Perl 6's killer advantages over Perl 5?

2015-08-27 Thread yary
On Thu, Aug 27, 2015 at 4:45 AM, Marc Chantreux kha...@phear.org wrote:
complete different usage but it would be nice to have a flag for use
strict both in perl5 and 6

/me nominates -W as a bigger -w .. oh wait, -W already exists as a
depreciated-in-my-view perl5 flag.

In that case, I also like -E as run a one-liner, as if it was loaded
from a file which would disable laxness in one-liners, for those who are
so inclined.

This discussion got me looking at http://design.perl6.org/S19.html which
may need an update, it says perl6 has no -M but Rakudo supports it; which
is correct?

Minor note, S19 links to S16-io which no longer exists. That link is in
the notes about there being no -0 switch due to a lack of specs in S16.

-y


Re: What are Perl 6's killer advantages over Perl 5?

2015-08-27 Thread David H. Adler
On Thu, Aug 27, 2015 at 10:35:27AM -0400, yary wrote:
 On Thu, Aug 27, 2015 at 4:45 AM, Marc Chantreux kha...@phear.org wrote:
 complete different usage but it would be nice to have a flag for use
 strict both in perl5 and 6
 
 /me nominates -W as a bigger -w .. oh wait, -W already exists as a
 depreciated-in-my-view perl5 flag.
 
 In that case, I also like -E as run a one-liner, as if it was loaded
 from a file which would disable laxness in one-liners, for those who are
 so inclined.

This is actually what I've been thinking during this discussion. I'm not
really seeing a pressing need for strict in one-liners, but
phiosophically, I can understand why one might want to have strict on in
all cases. So, if we think this is something that actually needs
solving, this mechanism seems reasonable to me.

 This discussion got me looking at http://design.perl6.org/S19.html which
 may need an update, it says perl6 has no -M but Rakudo supports it; which
 is correct?

The 5to6.pod document in the doc directory says it does exist. I lean
towards feeling the docs should be more correct/reliable than the design
documents, as that's where people outside the p6 creation bubble will be
looking for info (not that, at the moment, they necessarily *are* more
correct/reliable - work in progress and all...).

All that said, there doesn't, at a quck glance, seem to be any
equivalent to Perl 5's perlrun document, which would detail the
command line flags. Maybe I'll take a shot at something like that in
the coming days.

dha

-- 
David H. Adler - d...@panix.com - http://www.panix.com/~dha/
Your point being... - Homer Simpson


Re: What are Perl 6's killer advantages over Perl 5?

2015-08-27 Thread Marc Chantreux
On Wed, Aug 26, 2015 at 02:00:09PM -0400, Brandon Allbery wrote:
  It used to be, but that was not according to spec.  FROGGS++ implemented
  the lax mode, which is enabled by default in one-liners.  Perhaps TimToady
  wants to invoke rule #2 on this.
  Personally, I use an alias that has ‘-M strict’ in it.
 
 I was thinking -e vs. -E, like perl5

complete different usage but it would be nice to have a flag for use
strict both in perl5 and 6



-- 
Marc Chantreux (eiro on github and freenode)
http://eiro.github.com/
http://eiro.github.com/atom.xml
Don't believe everything you read on the Internet
-- Abraham Lincoln


Re: What are Perl 6's killer advantages over Perl 5?

2015-08-26 Thread Brandon Allbery
On Wed, Aug 26, 2015 at 1:58 PM, Elizabeth Mattijsen l...@dijkmat.nl wrote:

 It used to be, but that was not according to spec.  FROGGS++ implemented
 the lax mode, which is enabled by default in one-liners.  Perhaps TimToady
 wants to invoke rule #2 on this.

 Personally, I use an alias that has ‘-M strict’ in it.


I was thinking -e vs. -E, like perl5.

-- 
brandon s allbery kf8nh   sine nomine associates
allber...@gmail.com  ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net


Re: What are Perl 6's killer advantages over Perl 5?

2015-08-26 Thread Elizabeth Mattijsen
 On 26 Aug 2015, at 12:18, H.Merijn Brand h.m.br...@xs4all.nl wrote:
 
 On Wed, 26 Aug 2015 10:26:23 +0200, Moritz Lenz mor...@faui2k3.org
 wrote:
 
 I could continue with other Perl 5 deficiencies (no strict by default,
 
 Using strict *STILL* is not enabled by default for perl6
 one-liners either:

It used to be, but that was not according to spec.  FROGGS++ implemented the 
lax mode, which is enabled by default in one-liners.  Perhaps TimToady wants to 
invoke rule #2 on this.


Personally, I use an alias that has ‘-M strict’ in it.



Liz

Re: What are Perl 6's killer advantages over Perl 5?

2015-08-26 Thread H.Merijn Brand
On Wed, 26 Aug 2015 10:26:23 +0200, Moritz Lenz mor...@faui2k3.org
wrote:

 I could continue with other Perl 5 deficiencies (no strict by default,

Using strict *STILL* is not enabled by default for perl6
one-liners either:

$ perl6 -e'my Int $this = 1; $thıs++; say $this;'
1
$ perl6 -Mstrict -e'my Int $this = 1; $thıs++; say $this;'
===SORRY!=== Error while compiling -e
Variable '$thıs' is not declared. Did you mean '$this'?
at -e:1
-- my Int $this = 1; ⏏$thıs++; say $this;

That, IMHO, is a huge deficiency!

 lack of easy threading, too many globals, obscure regex syntax), but the 
 individual problems aren't the point. My main point is that large parts 
 of Perl 5 are still stuck in the past, with no good way forward.



-- 
H.Merijn Brand  http://tux.nl   Perl Monger  http://amsterdam.pm.org/
using perl5.00307 .. 5.21   porting perl5 on HP-UX, AIX, and openSUSE
http://mirrors.develooper.com/hpux/http://www.test-smoke.org/
http://qa.perl.org   http://www.goldmark.org/jeff/stupid-disclaimers/


pgpAZ7AgFClDH.pgp
Description: OpenPGP digital signature


Re: What are Perl 6's killer advantages over Perl 5?

2015-08-26 Thread Tom Browder
On Wed, Aug 26, 2015 at 3:26 AM, Moritz Lenz mor...@faui2k3.org wrote:
 Hi,

 On 11.08.2015 14:12, Tom Browder wrote:

 I have seen several lists of new Perl 6 features (versus Perl 5) but
 they all seem to be lists that intermix features with varying degrees of
 value to ordinary Perl 5 users.  If one wants to sell long-time Perl 5
 users (already using the latest Perl 5, Moose, etc.) on the value of
 Perl 6, what should be on the important feature list?
...

[Moritz tells of  many good, new features...]

Thanks, Moritz!

Cheers,

-Tom


Re: What are Perl 6's killer advantages over Perl 5?

2015-08-26 Thread Moritz Lenz

Hi,

On 11.08.2015 14:12, Tom Browder wrote:

I have seen several lists of new Perl 6 features (versus Perl 5) but
they all seem to be lists that intermix features with varying degrees of
value to ordinary Perl 5 users.  If one wants to sell long-time Perl 5
users (already using the latest Perl 5, Moose, etc.) on the value of
Perl 6, what should be on the important feature list?


on a more meta level: Perl 6 has the ability to evolve, and lots of 
things that Perl 5 most likely will never have.


Just as an example: when I started to get involved with Perl around 2003 
or '04 or so, people seemed to be aware that subroutine signatures were 
a good thing to have. They probably were aware of that much longer. And 
yet it took until perl 5.20 in 2014 to get even the most basic 
subroutine signatures (and still marked as experimental).


Another one is the inability to reliably introspect strings for whether 
they are text or binary data, which means enormous care must be taken to 
not accidentally mix the two. Again, known for ages that it's a problem, 
afaict no practical solution in sight.


These are just two examples of things that people take for granted in a 
modern programming language, yet Perl 5 has real trouble with.


I could continue with other Perl 5 deficiencies (no strict by default, 
lack of easy threading, too many globals, obscure regex syntax), but the 
individual problems aren't the point. My main point is that large parts 
of Perl 5 are still stuck in the past, with no good way forward.


Cheers,
Moritz


Re: What are Perl 6's killer advantages over Perl 5?

2015-08-26 Thread Marc Chantreux
On Wed, Aug 26, 2015 at 12:18:46PM +0200, H.Merijn Brand wrote:
 $ perl6 -e'my Int $this = 1; $thıs++; say $this;'
 1
 $ perl6 -Mstrict -e'my Int $this = 1; $thıs++; say $this;'
 ===SORRY!=== Error while compiling -e
 Variable '$thıs' is not declared. Did you mean '$this'?
 at -e:1
 -- my Int $this = 1; ⏏$thıs++; say $this;

 That, IMHO, is a huge deficiency! 

so usefull in most cases of oneliners! i really hope this deficiency is
here to stay :) 

-- 
Marc Chantreux (eiro on github and freenode)
http://eiro.github.com/
http://eiro.github.com/atom.xml
Don't believe everything you read on the Internet
-- Abraham Lincoln


Re: What are Perl 6's killer advantages over Perl 5?

2015-08-12 Thread H.Merijn Brand
On Tue, 11 Aug 2015 21:41:21 -0400, David H. Adler d...@pobox.com
wrote:

  The reason for my request is to help with a better introduction in my
  modest draft tutorial on converting Perl 5 to Perl 6 code at the Perl
  Monastery.  I am comfortable with the example code I use there (which is
  not currently intended to showcase new features), but I am getting several
  comments on why one should even bother with Perl 6?  
 
 In talking to Perl 5 people about my Perl 5 to Perl 6 docuentation,
 trying to get some feedback on it from people who aren't already doing
 Perl 6, I get this question a lot. So, yes, some kind of document saying
 these are reasons Perl 6 is actually useful would be very helpful.
 
 dha

*THE* killer feature that will be seen by all beginning perl6
programmers is its awesome error messages. It is a shame that
-e runs no-strict, but as I understand it, that is still under
discussion.

$ perl6 -e'use v6; my Int $this = 1; $thıs++; say $this;'
===SORRY!=== Error while compiling -e
Variable '$thıs' is not declared. Did you mean '$this'?
at -e:1
-- use v6; my Int $this = 1; ⏏$thıs++; say $this;


-- 
H.Merijn Brand  http://tux.nl   Perl Monger  http://amsterdam.pm.org/
using perl5.00307 .. 5.21   porting perl5 on HP-UX, AIX, and openSUSE
http://mirrors.develooper.com/hpux/http://www.test-smoke.org/
http://qa.perl.org   http://www.goldmark.org/jeff/stupid-disclaimers/


pgpbHSsqyiUAy.pgp
Description: OpenPGP digital signature


Re: What are Perl 6's killer advantages over Perl 5?

2015-08-12 Thread Tom Browder
On Wed, Aug 12, 2015 at 4:02 AM, Kamil Kułaga teodoz...@gmail.com wrote:
 One thing that was not mentioned already is using Rat instead of
 standard floating point number. It prevents many silly mistakes
 especially when counting money.

Thanks, Kamil.

-Tom


Re: What are Perl 6's killer advantages over Perl 5?

2015-08-12 Thread Tom Browder
On Tue, Aug 11, 2015 at 6:41 PM, Andrew Kirkpatrick uberm...@gmail.com wrote:
 Built-in facilities for the language to parse, transform and extend
...

Thanks, Andrew.

-Tom


Re: What are Perl 6's killer advantages over Perl 5?

2015-08-12 Thread Tom Browder
On Wed, Aug 12, 2015 at 2:00 AM, H.Merijn Brand h.m.br...@xs4all.nl wrote:
 On Tue, 11 Aug 2015 21:41:21 -0400, David H. Adler d...@pobox.com
...
 *THE* killer feature that will be seen by all beginning perl6
 programmers is its awesome error messages. It is a shame that
...

Thanks!

-Tom


Re: What are Perl 6's killer advantages over Perl 5?

2015-08-12 Thread Kamil Kułaga
One thing that was not mentioned already is using Rat instead of
standard floating point number. It prevents many silly mistakes
especially when counting money.

On Tue, Aug 11, 2015 at 2:12 PM, Tom Browder tom.brow...@gmail.com wrote:
 I have seen several lists of new Perl 6 features (versus Perl 5) but they
 all seem to be lists that intermix features with varying degrees of value to
 ordinary Perl 5 users.  If one wants to sell long-time Perl 5 users
 (already using the latest Perl 5, Moose, etc.) on the value of Perl 6, what
 should be on the important feature list?

 For me, stronger typing, named subroutine arguments, better classes and
 namespaces, object methods, and eventually better concurrency and compiled
 program persistence are among goodies long awaited.

 Thanks.

 -Tom

 The reason for my request is to help with a better introduction in my modest
 draft tutorial on converting Perl 5 to Perl 6 code at the Perl Monastery.  I
 am comfortable with the example code I use there (which is not currently
 intended to showcase new features), but I am getting several comments on why
 one should even bother with Perl 6?



-- 
Pozdrawiam

Kamil Kułaga


Re: What are Perl 6's killer advantages over Perl 5?

2015-08-12 Thread Fagyal Csongor

Hi,

On Tue, Aug 11, 2015 at 07:12:00AM -0500, Tom Browder wrote:

I have seen several lists of new Perl 6 features (versus Perl 5) but they
all seem to be lists that intermix features with varying degrees of value
to ordinary Perl 5 users.  If one wants to sell long-time Perl 5 users
(already using the latest Perl 5, Moose, etc.) on the value of Perl 6, what
should be on the important feature list?

For me, stronger typing, named subroutine arguments, better classes and
namespaces, object methods, and eventually better concurrency and compiled
program persistence are among goodies long awaited.

Thanks.

-Tom

The reason for my request is to help with a better introduction in my
modest draft tutorial on converting Perl 5 to Perl 6 code at the Perl
Monastery.  I am comfortable with the example code I use there (which is
not currently intended to showcase new features), but I am getting several
comments on why one should even bother with Perl 6?

In talking to Perl 5 people about my Perl 5 to Perl 6 docuentation,
trying to get some feedback on it from people who aren't already doing
Perl 6, I get this question a lot. So, yes, some kind of document saying
these are reasons Perl 6 is actually useful would be very helpful.

Just make them look at Perl6 source code. E.g. on rosettacode. Someone 
who doesn't see how wonderful Perl6 is, is a lost soul anyway. :)


- Fagzal


Re: What are Perl 6's killer advantages over Perl 5?

2015-08-12 Thread Tom Browder
On Tue, Aug 11, 2015 at 8:45 PM, Fagyal Csongor
csongor.fag...@kepesmedia.com wrote:
 On Tue, Aug 11, 2015 at 07:12:00AM -0500, Tom Browder wrote:
 I have seen several lists of new Perl 6 features (versus Perl 5) but they
 all seem to be lists that intermix features with varying degrees of value
 to ordinary Perl 5 users.  If one wants to sell long-time Perl 5 users
 (already using the latest Perl 5, Moose, etc.) on the value of Perl 6,
 what
 should be on the important feature list?
...
 Just make them look at Perl6 source code. E.g. on rosettacode. Someone who
 doesn't see how wonderful Perl6 is, is a lost soul anyway. :)

I agree!  Thanks, Fagyal.

-Tom


What are Perl 6's killer advantages over Perl 5?

2015-08-11 Thread Tom Browder
I have seen several lists of new Perl 6 features (versus Perl 5) but they
all seem to be lists that intermix features with varying degrees of value
to ordinary Perl 5 users.  If one wants to sell long-time Perl 5 users
(already using the latest Perl 5, Moose, etc.) on the value of Perl 6, what
should be on the important feature list?

For me, stronger typing, named subroutine arguments, better classes and
namespaces, object methods, and eventually better concurrency and compiled
program persistence are among goodies long awaited.

Thanks.

-Tom

The reason for my request is to help with a better introduction in my
modest draft tutorial on converting Perl 5 to Perl 6 code at the Perl
Monastery.  I am comfortable with the example code I use there (which is
not currently intended to showcase new features), but I am getting several
comments on why one should even bother with Perl 6?


Re: What are Perl 6's killer advantages over Perl 5?

2015-08-11 Thread Andrew Kirkpatrick
Built-in facilities for the language to parse, transform and extend
itself (std grammar, macros).
Prospect of multiple back-ends (compile to dotnet or LLVM targets like
Javascript).
Feel like you're living in the future (Perl6 has been in the future
for so long now).

On 11 August 2015 at 21:42, Tom Browder tom.brow...@gmail.com wrote:
 I have seen several lists of new Perl 6 features (versus Perl 5) but they
 all seem to be lists that intermix features with varying degrees of value to
 ordinary Perl 5 users.  If one wants to sell long-time Perl 5 users
 (already using the latest Perl 5, Moose, etc.) on the value of Perl 6, what
 should be on the important feature list?

 For me, stronger typing, named subroutine arguments, better classes and
 namespaces, object methods, and eventually better concurrency and compiled
 program persistence are among goodies long awaited.

 Thanks.

 -Tom

 The reason for my request is to help with a better introduction in my modest
 draft tutorial on converting Perl 5 to Perl 6 code at the Perl Monastery.  I
 am comfortable with the example code I use there (which is not currently
 intended to showcase new features), but I am getting several comments on why
 one should even bother with Perl 6?


Re: What are Perl 6's killer advantages over Perl 5?

2015-08-11 Thread David H. Adler
On Tue, Aug 11, 2015 at 07:12:00AM -0500, Tom Browder wrote:
 I have seen several lists of new Perl 6 features (versus Perl 5) but they
 all seem to be lists that intermix features with varying degrees of value
 to ordinary Perl 5 users.  If one wants to sell long-time Perl 5 users
 (already using the latest Perl 5, Moose, etc.) on the value of Perl 6, what
 should be on the important feature list?
 
 For me, stronger typing, named subroutine arguments, better classes and
 namespaces, object methods, and eventually better concurrency and compiled
 program persistence are among goodies long awaited.
 
 Thanks.
 
 -Tom
 
 The reason for my request is to help with a better introduction in my
 modest draft tutorial on converting Perl 5 to Perl 6 code at the Perl
 Monastery.  I am comfortable with the example code I use there (which is
 not currently intended to showcase new features), but I am getting several
 comments on why one should even bother with Perl 6?

In talking to Perl 5 people about my Perl 5 to Perl 6 docuentation,
trying to get some feedback on it from people who aren't already doing
Perl 6, I get this question a lot. So, yes, some kind of document saying
these are reasons Perl 6 is actually useful would be very helpful.

dha

-- 
David H. Adler - d...@panix.com - http://www.panix.com/~dha/
When I went to open my suitcase I found a lock on it, which I never
have. So I picked the lock, opened up the suitcase, and started pulling
out all these dresses. After like the 10th dress, I thought, These
aren't my dresses.  - John Malkovich


[perl6/specs] 1a6957: Changed equivalent of Perl 5's $0 from C$*PROGRAM...

2015-06-21 Thread GitHub
  Branch: refs/heads/master
  Home:   https://github.com/perl6/specs
  Commit: 1a695756c741797827546342a2f636d360cb3ca8
  
https://github.com/perl6/specs/commit/1a695756c741797827546342a2f636d360cb3ca8
  Author: David H. Adler d...@pobox.com
  Date:   2015-06-20 (Sat, 20 Jun 2015)

  Changed paths:
M S28-special-names.pod

  Log Message:
  ---
  Changed equivalent of Perl 5's $0 from C$*PROGRAM to C$*PROGRAM_NAME




Perl 5's $0 vs. Perl 6's $*EXECUTABLE_NAME

2015-05-30 Thread Tom Browder
I finally found the Perl 6 version of Perl 5's $0 listed in:

  tablets.perl6.org/appendix-b-grouped.html#special-variables

as '$*EXECUTABLE_NAME', and I expected it to act the same as $0 in
Perl 6, but I have two problems with it:

1.  When used it yields 'perl6' regardless of the script's name (a bug?).

$ cat t.pl
#!/usr/bin/env perl6
say $*EXECUTABLE_NAME;
$ chmod +x t.pl
$ ./t.pl
perl6

2.  It seems very ungainly to go from two characters to 17.  Couldn't
it be shortened a bit, say,

  '$*0' or '$*EXE_NAME' or '$*PROG' or something else?

Am I doing something wrong or do I have the wrong expectations?

$  perl6 --version
This is perl6 version 2015.03-48-g9746e88 built on MoarVM version 2015.03

Best regards,

-Tom


Re: Perl 5's $0 vs. Perl 6's $*EXECUTABLE_NAME

2015-05-30 Thread Paul Cochrane
On 30 May 2015 3:00:25 pm GMT+02:00, Tom Browder tom.brow...@gmail.com wrote:
I finally found the Perl 6 version of Perl 5's $0 listed in:

  tablets.perl6.org/appendix-b-grouped.html#special-variables

as '$*EXECUTABLE_NAME', and I expected it to act the same as $0 in
Perl 6, but I have two problems with it:

1.  When used it yields 'perl6' regardless of the script's name (a
bug?).

$ cat t.pl
#!/usr/bin/env perl6
say $*EXECUTABLE_NAME;
$ chmod +x t.pl
$ ./t.pl
perl6

2.  It seems very ungainly to go from two characters to 17.  Couldn't
it be shortened a bit, say,

  '$*0' or '$*EXE_NAME' or '$*PROG' or something else?

Am I doing something wrong or do I have the wrong expectations?

$  perl6 --version
This is perl6 version 2015.03-48-g9746e88 built on MoarVM version
2015.03

Best regards,

-Tom

Hi Tom,

I believe what you are looking for is called $*PROGRAM_NAME. See also 
http://doc.perl6.org/language/variables#Special_Variables

Cheers,

Paul

Re: Perl 5's $0 vs. Perl 6's $*EXECUTABLE_NAME

2015-05-30 Thread Tobias Leich
Please also take a look at $*EXECUTABLE, $*PROGRAM and $*PROGRAM_NAME.

Am 30.05.2015 um 15:00 schrieb Tom Browder:
 I finally found the Perl 6 version of Perl 5's $0 listed in:

   tablets.perl6.org/appendix-b-grouped.html#special-variables

 as '$*EXECUTABLE_NAME', and I expected it to act the same as $0 in
 Perl 6, but I have two problems with it:

 1.  When used it yields 'perl6' regardless of the script's name (a bug?).

 $ cat t.pl
 #!/usr/bin/env perl6
 say $*EXECUTABLE_NAME;
 $ chmod +x t.pl
 $ ./t.pl
 perl6

 2.  It seems very ungainly to go from two characters to 17.  Couldn't
 it be shortened a bit, say,

   '$*0' or '$*EXE_NAME' or '$*PROG' or something else?

 Am I doing something wrong or do I have the wrong expectations?

 $  perl6 --version
 This is perl6 version 2015.03-48-g9746e88 built on MoarVM version 2015.03

 Best regards,

 -Tom



Re: Perl 5's $0 vs. Perl 6's $*EXECUTABLE_NAME

2015-05-30 Thread Tom Browder
On Sat, May 30, 2015 at 8:30 AM, Tobias Leich em...@froggs.de wrote:
 Please also take a look at $*EXECUTABLE, $*PROGRAM and $*PROGRAM_NAME.

Tobias, I didn't find $*PROGRAM in the doc listed by Paul:

  http://doc.perl6.org/language/variables#Special_Variables

Also, the following were not in:

  http://tablets.perl6.org/appendix-a-index.html

that I could find.

  $*EXECUTABLE_NAME
  $*PROGRAM
  $*PROGRAM_NAME

From a Perl 6 newbie standpoint, it looks like there are too many docs
with overlapping purposes referenced on perl.org and which,
confusingly, have different pieces missing.  Except for the Synopses,
I'm not sure what document to go to for the definitive answer.  And,
as usual, I have no suggestions for an easy fix.

Thanks Paul and Tobias.

Best,

-Tom


Re: Perl 5's $0 vs. Perl 6's $*EXECUTABLE_NAME

2015-05-30 Thread Paul Cochrane
Hi Tom,

On Sat, May 30, 2015 at 09:03:17AM -0500, Tom Browder wrote:
 On Sat, May 30, 2015 at 8:30 AM, Tobias Leich em...@froggs.de wrote:
  Please also take a look at $*EXECUTABLE, $*PROGRAM and $*PROGRAM_NAME.
 
 Tobias, I didn't find $*PROGRAM in the doc listed by Paul:
 
   http://doc.perl6.org/language/variables#Special_Variables
 
 Also, the following were not in:
 
   http://tablets.perl6.org/appendix-a-index.html
 
 that I could find.
 
   $*EXECUTABLE_NAME
   $*PROGRAM
   $*PROGRAM_NAME

the docs at tablets.perl6.org aren't as up to date as those on
doc.perl6.org.  The doc.perl6.org docs are currently the reference work for
Perl6, however please note that they are very much a work in progress.

 From a Perl 6 newbie standpoint, it looks like there are too many docs
 with overlapping purposes referenced on perl.org and which,
 confusingly, have different pieces missing.  Except for the Synopses,
 I'm not sure what document to go to for the definitive answer.  And,
 as usual, I have no suggestions for an easy fix.

This I can understand.  We're doing our best to provide current and
accurate documentation.  Perl6 is a very large language, and thus gaps in
the documentation are to be expected; especially considering the volunteer
based nature of the project.

Thanks for pointing out the $*PROGRAM omission!  I've just added it to the
list of special variables and it should be available online within the next
10-15 minutes.

Kind regards,

Paul


Re: Perl 5's $0 vs. Perl 6's $*EXECUTABLE_NAME

2015-05-30 Thread Tom Browder
On Sat, May 30, 2015 at 9:03 AM, Tom Browder tom.brow...@gmail.com wrote:
 On Sat, May 30, 2015 at 8:30 AM, Tobias Leich em...@froggs.de wrote:
 Please also take a look at $*EXECUTABLE, $*PROGRAM and $*PROGRAM_NAME.

 Tobias, I didn't find $*PROGRAM in the doc listed by Paul:

But it is the only one of the group I found in Synopsis 28 (Special names).

In S28 I did find the Perl 5 to Perl 6 translation table in which I
had overlooked $0 before.

-Tom


Re: Perl 5's $0 vs. Perl 6's $*EXECUTABLE_NAME

2015-05-30 Thread Moritz Lenz
Hi,

On 05/30/2015 04:36 PM, Paul Cochrane wrote:
 Thanks for pointing out the $*PROGRAM omission!  I've just added it to the
 list of special variables and it should be available online within the next
 10-15 minutes.

Minor nit pick: according to the last log on
http://doc.perl6.org/build-log/ building the docs alone takes ~17min;
the cron job runs every 5 minutes, so it's more likely 17-22min before
it becomes available :-)

And thanks for adding $*PROGRAM to the docs!

Cheers,
Moritz


[perl #119293] Rakudo doesn't warn about Perl 5 $]

2015-02-16 Thread Will Coleda via RT
On Mon Oct 06 04:01:24 2014, barto...@gmx.de wrote:
 Unfortunately the error message is only Unexpected closing bracket
 now:
 
 13:00  bartolin r: say $]
 13:00 +camelia rakudo-{parrot,moar} 65819d: OUTPUT«===SORRY!===
 Error while compiling /tmp/tmpfile␤Unexpected closing bracket␤at
 /tmp/tmpfile:1␤-- say $⏏]

Re-fixed; test added to S32-exceptions/misc.t with the other perl5var tests.

There was still code around to deal with this in the exception class, but the 
check was lost from the grammar.

-- 
Will Coke Coleda


Re: External call like Capture::Tiny of Perl 5 ?

2015-01-03 Thread Gabor Szabo
thanks

I tried to describe what I know so far:
http://perl6maven.com/tutorial/running-external-commands-from-perl6

   Gabor

On Fri, Jan 2, 2015 at 4:44 PM, Tobias Leich em...@froggs.de wrote:

 This is in discussion right now, and since the recent pipe() addition,
 we have another bit implemented to actually make your proposal work.

 Though, we've not yet decided where we want to go, how one opens such a
 pipe or captures stdout/err, or does redirections of said handles...

 I hope we can say more in a few weeks.

 Am 02.01.2015 um 15:37 schrieb Gabor Szabo:
  I see there are 'run' and 'shell' functions that return the exit
  status in Proc::Status, and QX that returns the output. Wouldn't it be
  better to have a function the returns and object that contains both
  the status, the stdout and the stderr?
 
  e.g. extending Proc::Status to be able to hold those as well and
  changing QX to return
  that object?
 
  Gabor
 




Re: External call like Capture::Tiny of Perl 5 ?

2015-01-02 Thread Tobias Leich
This is in discussion right now, and since the recent pipe() addition,
we have another bit implemented to actually make your proposal work.

Though, we've not yet decided where we want to go, how one opens such a
pipe or captures stdout/err, or does redirections of said handles...

I hope we can say more in a few weeks.

Am 02.01.2015 um 15:37 schrieb Gabor Szabo:
 I see there are 'run' and 'shell' functions that return the exit
 status in Proc::Status, and QX that returns the output. Wouldn't it be
 better to have a function the returns and object that contains both
 the status, the stdout and the stderr?

 e.g. extending Proc::Status to be able to hold those as well and
 changing QX to return
 that object?

 Gabor




External call like Capture::Tiny of Perl 5 ?

2015-01-02 Thread Gabor Szabo
I see there are 'run' and 'shell' functions that return the exit status in
Proc::Status, and QX that returns the output. Wouldn't it be better to have
a function the returns and object that contains both the status, the stdout
and the stderr?

e.g. extending Proc::Status to be able to hold those as well and changing
QX to return
that object?

Gabor


[perl #73790] [BUG] Rakudo doesn't accept several -e options (but Perl 5 does)

2014-11-19 Thread Christian Bartolomaeus via RT
Recently there was a change in the S19-commandline design document 
(https://github.com/perl6/specs/commit/8f8c84034c) and now -e program stops 
option processing.

So the following is now expected behaviour

$ perl6 -e 'print OH HAI\n;' -e 'print OH BAI BAI\n'
OH HAI

$ perl6 -e 'say @*ARGS' -e 'print OH BAI BAI\n'
-e print OH BAI BAI\n

Since there is a passing test for -e working as a stopper in 
S19-command-line/dash-e.t I'm closing this ticket now. In case I overlooked 
something and there is still an issue, please reopen the ticket.


[perl #119293] Rakudo doesn't warn about Perl 5 $]

2014-10-06 Thread Christian Bartolomaeus via RT
Unfortunately the error message is only Unexpected closing bracket now:

13:00  bartolin r: say $]
13:00 +camelia rakudo-{parrot,moar} 65819d: OUTPUT«===SORRY!=== Error while 
compiling /tmp/tmpfile␤Unexpected closing bracket␤at /tmp/tmpfile:1␤-- say 
$⏏]



[perl #119293] Rakudo doesn't warn about Perl 5 $]

2014-02-24 Thread Will Coleda via RT
On Wed Aug 14 14:39:07 2013, lue wrote:
 lue r: say $]
 camelia rakudo c0814a: OUTPUT«===SORRY!=== Error while compiling 
 /tmp/bQ267__iqC␤Non-declarative sigil is missing its name␤at 
 /tmp/bQ267__iqC:1␤-- say ⏏$]␤ expecting any of:␤ argument list␤ 
 prefix or term␤ prefix or meta-prefix␤»…
 
 The error message should be closer to what STD says:
 
 lue std: say $]
 camelia std c2215f0: OUTPUT«===SORRY!===␤Unsupported use of $] 
 variable; in Perl 6 please use $*PERL_VERSION at /tmp/30I9vo1peV line 
 1:␤-- say $]⏏EOL␤Parse failed␤FAILED 00:00 42m␤»

Fixed. Closable with tests:

12:09  [Coke] m: say $]
12:09 +camelia rakudo-moar 299d70: OUTPUT«===SORRY!=== Error while compiling
 /tmp/_cHikCl3Xj␤Unsupported use of $] variable; in Perl 6
 please use $*PERL_VERSION␤at /tmp/_cHikCl3Xj:1␤-- say
 ⏏$]␤expecting any of:␤argument list␤ …»
-- 
Will Coke Coleda


  1   2   3   4   >