Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Redefining Imported Subs: of scope and no

by LanX (Chancellor)
on Feb 09, 2013 at 03:16 UTC ( #1017920=note: print w/replies, xml ) Need Help??


in reply to Redefining Imported Subs: of scope and no

> Unfortunately I can't have say something like no feature say unless $verbose;, can't use or no in conditional or anything like that.

maybe use feature is special, but normally use if should do that.

update

works for me:

use strict; use warnings; use constant VERBOSE=>0; use if VERBOSE, feature => "say"; sub say { print "nothing"; } say 'test';

Cheers Rolf

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1017920]
help
Chatterbox?
[ambrus]: LanX: that's funny because it's actually the upper class that sleep in hotels, so they're the ones who should know how it's pronounced
[LanX]: h is mute in French (and most other romanic languages)
[LanX]: https://en. oxforddictionaries .com/explore/words -with-silent-h
[LanX]: it's 'orrible zis langage...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (10)
As of 2017-03-27 17:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (321 votes). Check out past polls.