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:now...the main code mytest.pl (stored in /var/www/html/):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;
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!#!/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;
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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |