Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Why are you opposed to changing the original code? Is this a third party provided file so that your changes will be wiped out by the latest update? If so, that might be a good reason - PROVIDED that you document a hack using PadWalker very carefully with lots of asterisks and capital letters or other PAY ATTENTION TO ME signs in the code that uses. Anything private to a third party module is likely to get renamed, reengineered, restructured, or otherwise disappeared. Despite your goal of not touching third party code, your hack may still break with the next release of the third party code.

If this is internal company code, then you really are better off getting permission to change "my" to "our", even though it is major hassle. The problem with hacks like using PadWalker is that they are virtually impossible for the next programmer to discover who has your job after you. Anyone reading the source code of the file with the "my" variable will reasonably expect that variable not to be vulnerable to being messed with by outside modules. They will be going nuts trying to figure out what in the original module is making it change (nothing of course) they will NEVER think to look elsewhere outside of the file in the many company scripts to find your module playing hack with PadWalker. "my" is like a contract with future maintainers that outsiders won't muck with this.

Of course if the pesky module with "my" is yours and yours alone, then again why NOT change it to "our"?

In reply to Re: Can you override lexically scoped variables when sub-classing a module. by ELISHEVA
in thread Can you override lexically scoped variables when sub-classing a module. by learnedbyerror

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2021-10-27 14:32 GMT
Find Nodes?
    Voting Booth?
    My first memorable Perl project was:

    Results (93 votes). Check out past polls.