myModule has following code in its new sub routine, does it has any flaws:

I don't see any flaws with that "class method"

2. How do I use relative name scheme? (instead, of using : use lib 'D:\\Websiste\\One\cgi-bin';) I tried earlier, but it failed. Normal CGI scripts and myModule are in same directory.

?? File::FindLib - Find and use a file/dir from a directory above your script file
?? FindBin - Locate directory of original perl script

In myModule, I was using my $session = CGI::Session->load or die CGI::Session->errstr; at global scope to check sessions, before generating HTML contents. Now after your suggestion, I moved same code in each sub routine. But this duplicates code, and I have to write it in, every sub routine. Is there any work around for same. Or all session handling code should be put into different sub routine.

Um, try

sub new { my( $class, %args ) = @_; my $self = bless { %args }, $class my $query = CGI->new; my $sessionargs = $self->{sessionargs} || $default_sessionargs; my $session = CGI::Session->load( $sessionargs->{dsn}, $query, $sessionargs->{dsn_args}, ) or die CGI::Session->errstr; $self->{query} = $query; $self->{session} = $session; return $self; } sub param { my $self = shift; $self->{query}->param( @_ ); } sub session { $_[0]->{session}; } sub fandango { my( $self ) = @_; $self->param ...; ...; $self->session->param ...; ...; }

Things like that, see http://cgi-app.org//CGI::Application
http://mojolicio.us/perldoc/Mojolicious/Guides/Growing
Re^3: web applications: what is the correct way to realise web applications
Re: I need wisdom on structuring procedural code in Catalyst
Re: Form validation and best practice in CGI::Application
Re^2: mod_perl website structure
Re^2: High level OOP query ( Building Skills Object-Oriented Design Mindset Development )
Re^3: High level OOP query (internal data),
Re: RFC: beginner level script improvement (version control)
Re: Perl MIME parser partially works with my code I wrote (code does not exist , there is no code)


In reply to Re^3: Blank HTTP POST request, if script has another module in it. (CGI.pm) by Anonymous Monk
in thread Blank HTTP POST request, if script has another module in it. by msinfo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.