From: "Ruud H.G. van Tol" <rv...@isolution.nl> > On 2014-03-30 19:10, Octavian Rasnita wrote: >> From: "Dr.Ruud" <rvtol+use...@isolution.nl> >> >>> On 2014-03-30 12:26, Octavian Rasnita wrote: >>> >>>> But I also want that module to export strict and warnings. >>> >>> http://search.cpan.org/perldoc?Modern%3A%3APerl >> >> Thanks. I know about it but it is not helpful. > > How unimaginative you are. > > >> I want to use in my scripts just: >> >> use MyModule; >> >> #And here to have strict and warnings turned on >> #and to be able to call the exported subroutines: >> #sub1(); >> #sub2(); >> >> If I need to also add a "use Modern::Perl;", then it is no helpful >> because I don't need Modern::Perl's aditional features and I can simply >> use "use strict; use warnings;". > > So you first check out how Modern::Perl does it, and only then decide > that it is too hard for you to do it in a similar way. > > -- > Ruud
As I've seen, Modern::Perl exports only strict and warnings but not other subroutines, so it doesn't help because as I said, I can do that also using: sub import { strict->import; warnings->import; } But if I use this technique, I can't use Exporter nor Sub::Export because it gives the error "import subroutine redefined". I also tried to add a: __PACKAGE__->import in the import subroutine above, but it does an deep recursion in import() subroutine. I also tried to get the caller module and return if the caller module is the current module, so allow only first execution of import() subroutine when the caller is main, but then the subroutines from the module are not exported. Octavian -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/