Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: Perl Inheritance & module variables

by diabelek (Beadle)
on Sep 19, 2008 at 16:26 UTC ( #712547=note: print w/replies, xml ) Need Help??


in reply to Re: Perl Inheritance & module variables
in thread Perl Inheritance & module variables

Well that does what I want but I really hate having to turn off the strict refs... I think I would prefer to just copy the data into the instance and deal it with that way unless there is a lot of data i need to copy or its time sensitive. Unless there is a better way of doing it, I think I might just keep that in my back pocket for when I really do need it.

Thanks a bunch

  • Comment on Re^2: Perl Inheritance & module variables

Replies are listed 'Best First'.
Re^3: Perl Inheritance & module variables
by gone2015 (Deacon) on Sep 20, 2008 at 08:53 UTC

    Wishing to maintain "strict refs purity" is entirely commendable :-)

    For completeness, however, I'll point out that the 'no strict'-ness is scoped within the current block. So the unpleasantness is contained. In the code I gave the the nastiness was enclosed in a subroutine. If it's necessary to do this in 'open code' you can always:

    { no strict 'refs' ; .... # unspeakable stuff redacted } ;
    to avoid contagion

    Anyway, I think that with a small penance, in the form, say, of an explanatory comment, one can forgive oneself this particular sin -- provided it doesn't become a habit :-)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://712547]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2017-12-13 10:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (355 votes). Check out past polls.

    Notices?