Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Answer: How do I use @ISA and use strict at the same time?

( #85759=categorized answer: print w/ replies, xml ) Need Help??

Q&A > object-oriented programming > How do I use @ISA and use strict at the same time? contributed by Vynce

TIMTOWTDI:

use strict; package Question::Loaded; use vars ('@ISA'); @ISA = ('Question');
or
package Question::Open; @ISA = ('Question'); use strict;
or
package Question::MillionDollar; use strict; our @ISA = ('Question'); # if (perl -v >= 5.6)
and there are other ways, too. it's a matter of style.

Edit by tye: Note that use strict can appear before the package line but that putting use vars before the package line will cause the file to fail to compile while putting our before the package line will not work in less obvious ways.

Comment on Answer: How do I use @ISA and use strict at the same time?
Select or Download Code
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2014-08-22 08:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (150 votes), past polls