Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

I tried to hint at you that you should put in more effort into making it easy for other people to reproduce your problem. The easier it is for people to reproduce your problem and to inspect your code, the more likely it is that a solution or a workaround will be presented.

Dumping the whole code, littered with stuff inconsequential to the problem, like Readonly and weird aliasing, is not what I call effort, and it also does not help in making the problem obvious. This is menial work that you should have done yourself instead of running around in circles and screaming that you are the only person in the world who has encountered this bug in 5.14.x. Whenever you feel that you are the only person to have found a fundamental bug in a language, or in a compiler, I recommend doubting your own understanding of the matter instead of running around and claiming you have found the bug and everybody ignores you. Also see I am great at communicating, but people are bad at listening. If you feel that nobody understands you, it is far more likely that your communication is bad, than that people are bad at listening.

That you think that "use module" should do what you want is your prerogative. If you want to use Perl instead of your fantasy language though, it behooves you to read use to actually see what the use keyword does. Understanding that, and learning about how Perl exporting and symbol aliasing works will then also help you understand why your attempt fails as it does and why the BEGIN shehanigans are neccesary if you want to keep the rest of your program structure as is.

Personally, I recommend splitting up the program into separate files and not relying on weird initialization dances like first initializing lexical variables, just to initialize global variables from them. Again, see App::fatpacker if you are hell-bent on producing a single file after developing your program.


In reply to Re^9: can't import using exporter by Corion
in thread can't import using exporter by perl-diddler

Title:
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 How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-25 13:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found