On Sun, Jun 3, 2018 at 6:33 PM ToddAndMargo <toddandma...@zoho.com> wrote:

> On 06/03/2018 03:24 PM, Brandon Allbery wrote:
> > It is allowed if you have 'unit module RunNoShell;' at the top of
> > RunNoShell.pm6. Otherwise you defined it in the main namespace and
> > looking for it in the RunNoShell namespace will fail.
> >
> > Perl 5 does the same thing fi you omitted 'package RunNoShell;' at the
> > top of RunNoShell.pm.
> >
>
> The name of the file is `RunNoShell.pm`
>
> It has two exported subs:
>       sub RunNoShellErr ( $RunString ) is export
>       sub RunNoShell ( $RunString ) is export
>
> If I place
>       unit module RunNoShell;
>
> at the top, what happens?
>      All subs get exported?
>      Do I have to import them differently
>

What happens is your two subs get the full names

    RunNoShell::RunNoShellErr
    RunNoShell::RunNoShell

Without those lines, their full names are

    MAIN::RunNoShellErr
    MAIN::RunNoShell

Since you are explicitly running RunNoShell::RunNoShell, you get an error
with the second because there is no sub by that name.

Again, this is no different from Perl 5 if you forget to include 'package
RunNoShell;' And this matters only in the case where you explicitly asked
for RunNoShell::RunNoShell instead of just RunNoShell, which importing
handles for you.

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

Reply via email to