Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: My promiscous singleton

by 1nickt (Canon)
on Dec 29, 2019 at 18:07 UTC ( [id://11110732]=note: print w/replies, xml ) Need Help??


in reply to My promiscous singleton

Hi, not really an answer to your question about globals, but:

"So I want a logger object, and only one logger object though it may be used in various packages ... Controls both logging to a file and to the screen ... you can set a verbosity for each independently

Unless you are doing this a learning exercise, why not use Log::Any and the Log::Any::Adapter::Dispatch output adapter which allows you to do exactly what you specified, out of the box?

Hope this helps!


The way forward always starts with a minimal test.

Replies are listed 'Best First'.
Re^2: My promiscous singleton
by Random_Walk (Prior) on Dec 29, 2019 at 23:40 UTC

    Because it is a secure environment and I may not use any non core modules, other than those I write...

    I know, I know, but sometimes it's not worth the fight. And believe me it would take months, if not years/for ever to get sign off. But thanks for the common sense answer

    Cheers,
    R.

    Pereant, qui ante nos nostra dixerunt!
      Because it is a secure environment and I may not use any non core modules, other than those I write...

      Who came up with that nonsense idea? What makes core modules so special that they are suitable for a "secure" environment, but other modules from CPAN aren't? And what about that "insecure" CPAN modules that become core modules during the development of Perl? How do they suddenly become "secure"? Is the entire Perl source code subject to a code review?

      Or is "security" once more a lame excuse not to use CPAN? See also Re^4: CSV file with double quotes and NIH syndrome.

      Alexander

      --
      Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

        I think they consider Perl core to be well enough tested and reviewed by its widespread usage. The security team follow CVE closely and if any significant new vulnerability is found patching it is highest priority work (For all software we use). Other random modules from CPAN are an unknown and would need to be reviewed in depth. I realise I am more likely to introduce a novel bug re-creating wheels, but it has the advantage of not being deployed outside this organisation, so less likely to be found and exploited. Another site I have worked even removed most of the core modules. If you wanted one you needed a good reason and a review before it could be used. This sort of approach is common in banks (at least in Europe) with regular audits and a high chance you get your marching orders if you use any non-approved software. Any novel software does get a lengthy review including penetration testing, design reviews etc... Its possible but for something small like this quicker to write a new solution in house.

        Cheers,
        R.

        Pereant, qui ante nos nostra dixerunt!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11110732]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (2)
As of 2024-04-26 03:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found