Whoa, had no idea that this would spark such a lively discussion. Excellent.
I had intended to use say as an example - but it turned out to be the problem, huh? Ha! Go figure.
LanX - did not know about use if, so that's a neat plus. Hopefully you haven't quite yet learned your lesson about reading and replying to my ridiculously long posts ♥
Also comforting is that most of my solutions will work with normal non-CORE:: namespace imports.
As for all the advice in regards to how I ran into this question - debug output style/best practices and such - in the future I'll be going with aitap's great suggestion: Log::Log4perl. Very flexible and feature-rich, thanks for the tip!
BrowserUk, after diving the rabbit hole of replies, my question is/was/will be where do these definitions reside and how do I get at them?
Not so much how to get around a silly design decision I made =D
As usual, thanks for pointing me towards some great reading material. I'll definitely be playing around with Devel::Pragma to investigate any future questions in this vein.
So here we go:
- say lives in CORE::, where it can (usually) be accessed
- See ex::override for overriding CORE:: functions.
- use feature 'say' enables say as an operator - which means that once created it cannot be redefined.
- use if works, but has some constraints concerning order of your sub and verbosity definitions.
- Using say for debugging is silly - but educational!
Thanks to all of you for the great replies and entertaining repartee ;)
Strange things are afoot at the Circle-K.
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:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||