I want to replace the standardized beginning of perl scripts at my work that are starting with
#!/usr/bin/perl use strict; use warnings; use DBI; use Config::IniFiles; use IO::File; use utf8; # Skript ist UTF8-codiert use encoding 'utf8'; # Strings in UTF8 binmode STDOUT, ':utf8'; # Ausgaben in UTF8 use POSIX qw/strftime/; $ENV{ORACLE_HOME}="/opt/oracle/oracle/product/10.2.0/db_1"; $ENV{NLS_LANG}="GERMAN_GERMANY.UTF8"; # Datenbank ist UTF8
with something easier like
#!/usr/bin/perl use MyFirma::Standard; # and now I want to use and have everything like above
I know, it should be done with an exporter module, but I don't want just to import some subs but instead load the modules into namespace of the caller. Like Modern::Perl imports use strict; use warnings; use feature ...; into the callers package. In addition it should be easy to understand what is done (so I'd prefer not to hack around with mro::caller-stuff or different), just like
package MyFirma::Standard; use GreatExporter => {'use strict', 'use warnings', 'use DBI', ... and so on}
I think, I have already seen a module doing this, but I don't remember and I'm stuck finding the right words to search, so I hope you can help me here

Greetings,
Janek Schleicher


In reply to How to export several modules intu users name space to not have a use ...; use ...; use ...; with the same modules all over again by bigj

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.