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

Re: :: question

Thread Previous | Thread Next
From:
ToddAndMargo
Date:
September 17, 2017 20:38
Subject:
Re: :: question
Message ID:
7264d5f4-14ad-b79c-d5c8-d847b1070f54@zoho.com
>>> On Fri, Sep 15, 2017 at 5:39 PM, ToddAndMargo <ToddAndMargo@zoho.com 
>>> <mailto:ToddAndMargo@zoho.com>> wrote:
>>> 
>>>     On 09/13/2017 10:57 PM, Brandon Allbery wrote:
>>> 
>>>         On Thu, Sep 14, 2017 at 1:48 AM, Brandon Allbery
>>>         <allbery.b@gmail.com <mailto:allbery.b@gmail.com>
>>>         <mailto:allbery.b@gmail.com <mailto:allbery.b@gmail.com>>> wrote:
>>> 
>>>              If you want to use the other way, the CheckSystemDependency
>>>         module
>>>              MUST define Which as: our sub Which ...
>>>              If it is not explicitly declared "our", then it is declared
>>>         "my" and
>>>              the only way the name can be seen outside the
>>>         CheckSystemDependency
>>>              module is for it to be exported and for your module to
>>>         import it.
>>> 
>>>              You cannot simply call any sub you see in a different
>>>         module. If it
>>>              is not explicitly declared "our" then you cannot access it;
>>>         it is
>>>              declared locally to that module and cannot be seen anywhere
>>>         else.
>>> 
>>> 
>>>         If this is still not clear, let's try an example:
>>> 
>>>             pyanfar Z$ 6 'module Foo { sub a { say "nope" }; our sub b {
>>>         say "yep" } }; Foo::b();'
>>>             yep
>>>             pyanfar Z$ 6 'module Foo { sub a { say "nope" }; our sub b {
>>>         say "yep" } }; Foo::a();'
>>>             Could not find symbol '&a'
>>>               in block <unit> at -e line 1
>>> 
>>> 
>>     Hi Brandon,
>> 
>>     What am I doing wrong, now?
>> 
>>     in the pm6:
>> 
>>     9:  our sub Which (
>>     10:    $ProgramName,    # name of the program to search for
>>     11:    $HowToExit )     # live | die
>>     12: is export {
>> 
>> 
>>     in the pl6:
>> 
>>     8:  use CheckSystemDependancy; # qw[ Which ];
>>     36: $Found = CheckSystemDependancy::Which( $ProgramName, $HowToExit );
>> 
>> 
>>     Error:
>> 
>>     Could not find symbol '&Which'
>>        in block <unit> at ./CheckSystemDependancy.pl6 line 36
>> 
>> 
>>     -T

On 09/17/2017 06:08 AM, yary wrote:
 > 9:  our sub Which (
 >
 > What if you remove the space between Which and the paren?
 >
 > -y
 >


No symptom change.

:'(

That space thing is a bad habit I picked up from Perl 5

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