develooper Front page | perl.perl6.users | Postings from September 2017

Re: :: question

Thread Previous | Thread Next
Brandon Allbery
September 14, 2017 05:26
Re: :: question
Message ID:
On Thu, Sep 14, 2017 at 12:46 AM, ToddAndMargo <>

> What is the Perl6 equivalent of the perl 5 "::"?
> $Found = CheckSystemDependancy::Which ( $ProgramName, $HowToExit );

It's the same... but unlike Perl 5, there is a difference between subs and
methods, and subs are lexical by default (that is, they behave as if
defined "my sub ..." --- which syntax is legal in Perl 6 (and I think in
sufficiently recent perl 5 if you specify a minimum version in your
script)). For a sub to be callable that way, it must explicitly be defined
as "our sub ...".

Although you will run into another issue because you have whitespace before
the "(", so it will be called with one parameter that is a 2-element list.
brandon s allbery kf8nh                               sine nomine associates                        
unix, openafs, kerberos, infrastructure, xmonad

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About