Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
... Sorry. Breaking apart a 800 line perl prog that was a 185 line shell script , into a 10-15 file perl monster is messed up. ... The problem with simplifying all those pesky aliases and RO var, is that oft' times the problem becomes induplicable. ...

This process is called debugging. If you are programming, you should familiarize yourself with it. If the problem becomes "induplicable", that means you have just eliminated one source of your problems. But it feels to me that you prefer others to put effort in solving your problems over cleaning your room first before asking for help.

... you put 90% of the the program in BEGIN{}. ... You can't develop a program entirely in Begin.

My approach mechanically reproduces what use does. If that does not suit you, then you will have to restructure your code in a way that it does not rely on how use works. I'm not sure why you are hell-bent on doing things the way you do them, but I showed you where your approach fails and how you need to modify your approach to get to a result. Your impression that "standard methods" don't work is owed to the fact that you did not present the relevant code and did not show how you tried to rely on symbol exports happening at the right time. The "standard methods" rely on the programmer understanding Perl and understanding how and when symbols are exported from modules. I suggest that you learn more Perl.

Also, it may surprise you, but you can easily develop a program entirely in BEGIN blocks, as long as you understand what BEGIN blocks are and what they do.

The module suggested doesn't run on 5.14 without errors -- indicating that 5.14 has now broken it as well.

Again, extraordinary claims require extraordinary evidence. The CPAN tester Matrix for Module::Util shows no breakage, and you have shown lots of broken code that you produce, and concepts that you misunderstand or ignore. In so far, I really, really recommend that you don't claim things that you do not have a program with less than 10 short lines for to reproduce them.

Your program is a onerous, though proven, workaround, but it also gives ample fodder to any perl-hater out there about how broken a language perl is, because having to do that to have multiple classes in the same file is broken.

No. You don't need to do any of that to have multiple classes in the same file. This only shows that you don't understand what you are doing. You are not declaring a single class in your code. As you claim to be educated by merlyn and brian d foy, it would amuse me if you found a section in their books or a statement by them where they claim that your shown approach is somehow object oriented and has entities where "class" would be an appropriate moniker. Especially the lack of the bless keyword is a certain indicator that you are not dealing with objects and classes in your code.


In reply to Re^11: 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 making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2024-04-26 01:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found