in reply to Re: How to export several modules intu users name space to not have a use ...; use ...; use ...; with the same modules all over again
in thread How to export several modules intu users name space to not have a use ...; use ...; use ...; with the same modules all over again

Sometimes it is too easy :-o It imports the modules like DBI, but it doesn't look like the strict and warnings pragmas are imported also. Update: Also POSIX::strftime doesn't get imported, just only into the module package MyFirma::Standard

Greetings,
Janek Schleicher

  • Comment on Re^2: How to export several modules intu users name space to not have a use ...; use ...; use ...; with the same modules all over again

Replies are listed 'Best First'.
Re^3: How to export several modules intu users name space to not have a use ...; use ...; use ...; with the same modules all over again
by Discipulus (Canon) on Jan 12, 2015 at 10:34 UTC
    ok, never realized all subtitlies (quibbles?) of using.. and in the import of Modern::Perl there is something i dont understand but i can replicate.
    While i suggest following wiser adivice you can play with:
    package FirmaTest { print "welcome to FirmaTest\n"; sub import { use feature (); feature->import ('say'); } use strict; #strictures are imported # while warnings are not #use warnings; seems not enough.. $^W=1; # but setting $^W seems ok! $ENV{'FirmaTest'} = 1;#it works use POSIX qw (strftime); } 1;
    It seems to do the right think you want (notice the windows quotation..):
    perl -MFirmaTest -e " print qq(warnings: $^W\n); print qq(ENV: $ENV{'F +irmaTest'}\n); say qw(saying: aa) my $str = POSIX::strftime( '%B %d, %Y',0, 0, 0, 12, 11, 115, 2 );say +qq(POSIX::strftime: $str) " #output: welcome to FirmaTest warnings: 1 ENV: 1 saying:aa POSIX::strftime: dicembre 12, 2015
    HtH
    L*
    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
Re^3: How to export several modules intu users name space to not have a use ...; use ...; use ...; with the same modules all over again
by vkon (Curate) on Jan 12, 2015 at 09:41 UTC
    use strict; is lexical-scope-wise, it is specially designed to behave this way, so you can write
    use strict; .... { no strict; .... } # and here 'use strict' is in effect;
    this is why