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

Re: Reopen a class, add methods ?

by ikegami (Patriarch)
on May 13, 2007 at 02:03 UTC ( [id://615136]=note: print w/replies, xml ) Need Help??


in reply to Reopen a class, add methods ?

I recommend changing the package for the reasons I already gave.

However, instead of

package Tk::HList; sub updaterow { ... } package main;

I'd use

{ package Tk::HList; sub updaterow { ... } }

The package directive will only be effective until the end of the block, at which time the package will revert to what it was before the package directive was encountered.

Hardcoding main will cause code to fail once ported to Apache::Registry, or if the code is copied/moved into a module.

Replies are listed 'Best First'.
Re^2: Reopen a class, add methods ?
by Rudif (Hermit) on May 13, 2007 at 15:27 UTC
    ikegami,

    Thank you (and others) for clarifications and guidance. A  package directive in a block works fine for me.

    Rudif

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2024-04-24 05:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found