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.
--
જલધર
In reply to Re: Understanding module structure and inheritance
by jaldhar
in thread Understanding module structure and inheritance
by bradcathey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |