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

Re: :: question

Thread Previous | Thread Next
From:
ToddAndMargo
Date:
September 14, 2017 05:42
Subject:
Re: :: question
Message ID:
3dcdc5bd-d2dc-7666-cfed-2b0ea0ec7609@zoho.com
On 09/13/2017 10:26 PM, Brandon Allbery wrote:
> On Thu, Sep 14, 2017 at 12:46 AM, ToddAndMargo <ToddAndMargo@zoho.com 
> <mailto:ToddAndMargo@zoho.com>> wrote:
> 
>     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
> allbery.b@gmail.com <mailto:allbery.b@gmail.com> ballbery@sinenomine.net 
> <mailto:ballbery@sinenomine.net>
> unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net


8:  use CheckSystemDependancy; # qw[ Which ];
35: #$Found = Which( $ProgramName, $HowToExit );
36: $Found = CheckSystemDependancy::Which( $ProgramName, $HowToExit );

$ CheckSystemDependancy.pl6 ls live
Could not find symbol '&Which'
   in block <unit> at ./CheckSystemDependancy.pl6 line 36

Line 35 works, but line 36 does not.

I am stumped

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About