in reply to Inheritance and Container Classes and use/require
will result in no errors in the $cgi line.use strict; use Data::Dumper; my $obj = do_sub(); print Dumper $obj; my $cgi = new CGI; print Dumper $cgi; sub do_sub { use CGI; return new CGI; }
As for what you have, you probably want to implement the so-called 'factory' class that you don't instantiate from, but instead use 'static' methods that creates your various subclass instances given the class name in addition to any data that they need. In the perl implementation, this need not necessarily be a separate class, but it's easier to set up this functionality in this fashion if you're not used to it.
-----------------------------------------------------
Dr. Michael K. Neylon - mneylon-pm@masemware.com
||
"You've left the lens cap of your mind on again, Pinky" - The Brain
"I can see my house from here!"
It's not what you know, but knowing how to find it if you don't know that's important
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Inheritance and Container Classes and use/require
by TGI (Parson) on Jan 03, 2002 at 02:57 UTC |