Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

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

by Vynce (Friar)
on Jun 05, 2001 at 13:45 UTC ( #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? - Answer contributed by Vynce


use strict; package Question::Loaded; use vars ('@ISA'); @ISA = ('Question');
package Question::Open; @ISA = ('Question'); use strict;
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.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2016-10-26 10:06 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (338 votes). Check out past polls.