http://www.perlmonks.org?node_id=1017927


in reply to Redefining Imported Subs: of scope and no

or even simpler:

use strict; use warnings; no feature "say"; sub say { print "nothing"; } say 'test';

Edit--Hey, that doesn't work! Where's the ability to flip the real say() back on?

Replies are listed 'Best First'.
Re^2: Redefining Imported Subs: of scope and no
by LanX (Saint) on Feb 09, 2013 at 14:37 UTC
    You're confusing me!

    Why do you always seem to ask me if you reply to someone else?

    Please don't be surprised if I'm not replying.

    And please don't simply change your posts after being proofed wrong in a reply.

    > Where's the ability to flip the real say() back on?

    Just swap no with use!

    feature should be scoped (in this example file scoped), which makes much sense when debugging!

    Otherwise the OP could (like already shown) do "use if" for testing a global constant like main::VERBOSE spreading all files.

    Anyway manipulating say for debugging purpose is such a broken idea that I don't wanna invest more into this discussion... :)

    Cheers Rolf

      And please don't simply change your posts after being proofed wrong in a reply.

      Huh? Where? What? Are you talking about the post where I congratulated you on such a simple solution? I didn't see where you 'proofed' that offering congratulations was wrong?
        the one about "goatse getting into the wheels of your bike" or so in this post

        EDIT: you practically deleted everything I didn't quote in the reply.

        Cheers Rolf