in reply to Understanding module structure and inheritance
ok, let's see if I can answer this without confusing myself in the process :-)
First the easy question: yes this is the kind of layout I and I would say most CGI::Application use too. It's a bit safer if your code packages or templates are not in an area accessible to the web server. However you've got some errors.
Contact.pm should be in a directory called Main. (:: is replaced by the directory separator for your particular OS.)
Main.pm doesn't need the shebang line but does need one which says package Main;
In calling.cgi use Main::Contact not Contact::Contact.
Update: friedo is right and I have oversimplified far too much. What I am trying to get is that when you inherit a class that classes symbols are "yours" whereas with "use" the symbol remains "foreign" in a way though it is available to you. Hope this is clearer.
--
જલધર
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Understanding module structure and inheritance
by friedo (Prior) on Jan 30, 2008 at 14:54 UTC | |
|
Re^2: Understanding module structure and inheritance
by bradcathey (Prior) on Jan 30, 2008 at 15:30 UTC | |
by jaldhar (Vicar) on Jan 30, 2008 at 15:42 UTC | |
by naikonta (Curate) on Jan 30, 2008 at 18:35 UTC |