thank you so much for ALL of that input. it worked well, although it did take a while. managed to connect my www webaddress to my public IP and all is working as you might expect, mostly. at least, Apache is now returning SOMETHING...albeit very confusing.

you see, an issue has cropped up since these changes. now none of my modules work. my main site code (for .pl scripts) is stored in the /var/www/html/ and my modules are stored in /var/www/html/Pm

here's a simple module i have stored in /var/www/html/Pm/ - it's just my 'TEMPLATE.pm' so i don't mess up making new modules:
package Pm::TEMPLATE; # change TEMPLATE to whatever you need it to be #/ # a template pm so i don't gotta type all this all the time #/ use strict; use warnings; use Exporter; use vars qw($VERSION @ISA @EXPORT_OK); use CGI; $VERSION = 1.00; @ISA = qw(Exporter); @EXPORT_OK = qw( an_exported_sub ); use lib "/var/www/html/Pm"; # in case other modules i make need to be +added into this module my $TABLE_BORDER = 0; my $DEBUG = 0; sub an_exported_sub($$) { #* # an exported sub description/information #* my ($param1, $param2) = @_; # param one && param 2 return 1; # a return value of 1 #usage: my $val = an_exported_sub($someval, $someotherval); } 1;
now...the main code mytest.pl (stored in /var/www/html/):
#!/usr/bin/perl # must have's! use strict; use warnings; use CGI::Carp qw(fatalsToBrowser); use DBI; use URI::Escape; use lib "/var/www/html/Pm"; use TEMPLATE qw(an_exported_sub); my $DEBUG = 0; my $output = "content-type: text/plain\n\n"; print $output . an_exported_sub(1, 2); exit 1;
i use geany and i can press F8 on TEMPLATE.pm - compiles just fine. press F8 on mytest.pl and it compiles just fine, too. so i'm a bit lost as to why an_exported_sub(1, 2) isn't found...which is unbelievably mind-boggling!

when i run this, i get the following error msg: Undefined subroutine &main::an_exported_sub called at /var/www/html/mytest.pl line 18.


In reply to Re: perl and apache2 on ubuntu 17.04 by jamroll
in thread perl and apache2 on ubuntu 17.04 by jamroll

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.