Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

warnings for modules < 5.6

by liz (Monsignor)
on Jul 29, 2003 at 12:09 UTC ( #278796=snippet: print w/replies, xml ) Need Help??
Description: Since it seems there is not going to be a quick solution to the problem of modules running under perl < 5.6 with "use warnings" (see 278753), I thought I'd add this piece of code to the snippets. Courtesy of Podmaster. Documentation added for those monks not really familliar with BEGIN, GLOBs and %INC.


# Do this at compile time


#  Check if there is a warnings module available

    eval {
        require warnings;

#  If not, create dummy "import" and "unimport" subroutines

    } or do {
        no strict 'refs';
        *warnings::import = *warnings::unimport = sub{};

#  Make sure no attempt will be made to load the "" file ev
+er again

        $INC{''} = '';
Replies are listed 'Best First'.
Re: warnings for modules < 5.6
by Jenda (Abbot) on Aug 13, 2003 at 12:32 UTC

    The fake import() and unimport() is not necessary actually.

    Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
       -- Rick Osborne

    Edit by castaway: Closed small tag in signature

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: snippet [id://278796]
[Corion]: Once more, I'm looking for a sane client-side framework, but I guess these don't exist. Everything I look at either uses a weirdo home-grown templating language (like Angular in all its incarnations) or uses weirdo Javascript incarnations (like ...
[Corion]: ... Inferno.js, which uses ES2015) or uses some horrible amount of Javascript infrastructure before you can even render a single file.
[Corion]: I'd really like to create a dynamic frontend for my Google Keep clone, but so far, all the templating solutions seem to bring their own template language or require me to hand-code everything in (their own flavour of) Javascript. I'd like something ...
[Corion]: ... that can use templates from the HTML (via <script language="text/ template">... my template ...</script> and otherwise gets out of my way. But it seems that is not how the Javascript world is, currently :-/
[Corion]: I guess my question is, has anybody worked with React, Ember, Angular (v2, v4, v.whatever) or any other JS client-side dynamic rendering/virtual DOM thingie and found a simple, single-file solution like jQuery?

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (12)
As of 2017-03-27 19:00 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (321 votes). Check out past polls.