Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Using my version of a cpan module

by bliako (Monsignor)
on Jul 20, 2019 at 10:23 UTC ( [id://11103073]=note: print w/replies, xml ) Need Help??


in reply to Using my version of a cpan module

IMO the approach should be to extend the module you are now trying to modify to, e.g. Unicode::CharName::More. That said, I will use the author's excuse for not posting any more code now: # XXX: could use a binary search, but I am too lazy today... my excuse is that I am going for swimming in a few minutes in the deep blue and with good company.

On the other hand, installing said module failed for me (linux) because dependency Unicode-String-2.09 fails with Can't use 'defined(%hash)' (Maybe you should just omit the defined()?). So perhaps using the charnames haj mentioned could be wiser and if you really need a ublock() function extend said module.

Replies are listed 'Best First'.
Re^2: Using my version of a cpan module
by markong (Pilgrim) on Jul 20, 2019 at 22:34 UTC

    This make more sense: in general if you want to customize some installed module which uses object orientation, you should subclass it and override the relevant bits and pieces.
    This also prevent you the hassle of mantaining a local modified copy of modules and playing with your OS's @INC definition to let perl having access to their location.

      what's best practice for non-object-oriented modules? (like the ones mentioned above.) Do you just use it and then provide your own improved subs which subsume existing ones?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11103073]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (1)
As of 2024-04-25 03:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found