Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: (t'mo) - (tilly) Generating similar functions in unrelated objects

by t'mo (Pilgrim)
on Aug 31, 2001 at 16:37 UTC ( #109365=note: print w/replies, xml ) Need Help??


in reply to Re (tilly) 3: Generating similar functions in unrelated objects
in thread Why I hate File::Find and how I (hope I) fixed it

You know what happened, don't you? Just as I was leaving the building, not more than five minutes after I asked the question, the answer came to me: symbol table. :-)

The import approach is interesting. It gives me more food for thought, especially in relation to this question I asked about writing your own import. Thanks.

  • Comment on Re: (t'mo) - (tilly) Generating similar functions in unrelated objects
  • Download Code

Replies are listed 'Best First'.
Re (tilly) 3: Generating similar functions in unrelated objects
by tilly (Archbishop) on Aug 31, 2001 at 17:54 UTC
    Are custom imports a good idea?

    Can I say it depends?

    Most of what I was saying about AUTOLOAD at Re (tilly) 4: Perl and Objects, how do you resolve the two? applies to custom imports as well. A custom import is like a very good sword without a hilt. It can cut really well, but you need to be very cautious before using it.

    My rule of thumb is this. If my custom import could be done with Exporter, I don't use it. If it makes for a significantly improved interface and works very differently, then I will consider it. But if I won't actually use it unless I am going to make it a meme in the body of code that I am working on. It doesn't matter how nice each customized rule is, a million and one customized high-level interfaces is unmaintainable.

    Or, to put it a different way, It is OK to be clever, but only one person should be being clever at a time.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://109365]
help
Chatterbox?
[Discipulus]: choroba i made you Bishop !!
[choroba]: 9999 points until level 23 - Archbishop.
[LanX]: darn trying to downvote him again fails ... ;-P
[Discipulus]: congrats!
[LanX]: His Excelleny Choroba will now nbe clothed in his new robe ...
[Discipulus]: bishop ship sheeps in the shop..
[1nickt]: Discipulus too easy!
[1nickt]: "The sixth sheik's sixth sheep's sick" (if you are after 'sh' tongue twisters)
[Discipulus]: ok try it in Eatalian ;=)
[Eily]: Discipulus I don't suppose you can do the same for me can you ? :P

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (11)
As of 2017-09-26 12:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (294 votes). Check out past polls.

    Notices?