in reply to Re: Help with proper construction of callable scalars from a Module, please.
in thread Help with proper construction of callable scalars from a Module, please.
I just came back to report that I finally sorted it out. Only to find your kind words of wisdom. :)
This is what I ended up with (pageblocks.pm):
...and in index.cgi:use strict; package webblocks; 1; # LOADING THIS MODULE in index.cgi returns UNDEF || FALSE without t +his sub print_xmlheader { return "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; } sub print_xmldtd { return "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"h +ttp://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\"> <html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en +\"> <head> <meta http-equiv=\"content-type\" content=\"application/xhtml+xml; + charset=utf-8\" />\n"; }
print "content-type:text/html; charset=utf-8\n\n"; use lib ('./'); use pageblocks; print pageblocks::print_xmlheader(); print pageblocks::print_xmldtd(); ...
I notice the version you posted retains my original print statements. Is there any reason I shouldn't use the return statements I've just chosen?
"Define "actually works"." So noted. Thank you.
--Chris
#!/usr/bin/perl -Tw use Perl::Always or die; my $perl_version = (5.12.5); print $perl_version;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Help with proper construction of callable scalars from a Module, please.
by Anonymous Monk on Nov 13, 2013 at 12:52 UTC | |
|
Re^3: Help with proper construction of callable scalars from a Module, please.
by taint (Chaplain) on Nov 13, 2013 at 02:28 UTC | |
|
Re^3: Help with proper construction of callable scalars from a Module, please.
by ig (Vicar) on Nov 13, 2013 at 17:29 UTC | |
by taint (Chaplain) on Nov 13, 2013 at 19:11 UTC |