http://www.perlmonks.org?node_id=517468

rjsaulakh has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: getting module o/p in a cgi file
by bradcathey (Prior) on Dec 17, 2005 at 13:18 UTC

    Like the good monks have been telling you, use a templating system like HTML::Template and a lot of your issues will dissolve away. Get the HTML out of your CGI. It's sooooo much easier.


    —Brad
    "The important work of moving the world forward does not wait to be done by perfect men." George Eliot
Re: getting module output in a cgi file
by Joost (Canon) on Dec 17, 2005 at 15:59 UTC
    Remove the exit statement or you won't even be able to use the module. also, I'd STRONGLY suggest using strict, lexical variables and pass the values as function arguments instead of relying on vars that are declared (or not) SOMEWHERE else.

    then do something like:

    use ModuleName; # ... pageNumbers($total_pages,$matches,$total_records_page, @and_whatever_o +ther_variables_you_need);
Re: getting module output in a cgi file
by Your Mother (Archbishop) on Dec 17, 2005 at 19:43 UTC

    Don't forget that using abbreviations like "o/p" can be confusing to readers who aren't sure what they mean especially in this case when I believe you actually meant G.O. (Kidding!)