*acts like a sponge and absorbs everything*
Alright, thx! Been trying to get it to work, without luck though.
test.cgi
#!c:/apache/perl/bin/perl.exe
BEGIN {
$| = 1;
open (STDERR, ">&STDOUT");
print qq~Content-type: text/html\n\n~;
}
use CGI;
use strict;
use lib qw( c:/apache/cgi-bin/lib );
use MyAppCommon; # use is basically like require... see the docs for
my $foo = new CGI;
print $foo->header;
MyAppCommon::top();
print "Test content (should be in middle)<br><br><br><br>\n";
MyAppCommon::bottom();
MyAppCommon.pl (.pl a necessary extension? or can it be .cgi?)
use strict;
sub top {
print "Top stuff<br><br>";
}
sub test {
print "Bottom stuff<br><br>";
}
1;
Assuming the code above, where am I suppose to save MyAppCommon.pl? Does it need to be compiled somehow?
I know I could put it in the bin on my test environment, but I want to mimic my website's environment as best possible, so would like to have it in a subdirectory of my cgi-bin.
Thx again for all the help, time, and patience! I'm learning a ton tonight :-)
Stenyj
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.