in reply to Re^2: While loop does not terminate
in thread While loop does not terminate

Strictures don't bleed through to included packages. Consider:

# noname.pl: use warnings; use strict; use lib '.'; use noname1; print noname1::get_value(); # noname1.pm: package noname1; sub get_value { return $missingVar // 'Bogus value'; } 1;

Prints:

Bogus value
Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond

Replies are listed 'Best First'.
Re^4: While loop does not terminate
by LanX (Saint) on Dec 13, 2020 at 21:19 UTC
    I supposed it's obvious that strictures must be used in each file, since pragmas are scoped.

    # noname1.pm: use strict; use warnings; package noname1; sub get_value { return $missingVar // 'Bogus value'; } 1;

    now running ...

    # noname.pl: use warnings; use strict; use lib '.'; use noname1; print noname1::get_value();

    output

    Compilation started at Sun Dec 13 22:16:46 C:/Perl_524/bin\perl.exe -w d:/tmp/pm/noname_strictures/noname.pl Global symbol "$missingVar" requires explicit package name (did you fo +rget to declare "my $missingVar"?) at noname1.pm line 9. Compilation failed in require at d:/tmp/pm/noname_strictures/noname.pl + line 6. BEGIN failed--compilation aborted at d:/tmp/pm/noname_strictures/nonam +e.pl line 6. Compilation exited abnormally with code 255 at Sun Dec 13 22:16:46

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery