in reply to Re^2: Trouble usig a subroutine from a custom module
in thread Trouble usig a subroutine from a custom module

Something is off here.

I copied the program to a file ~/_/0/1.pl and the module to ~/_/0/customPerlMod.pm. I changed the path to lib to actually point to the directory:

use lib $ENV{HOME} . '/_/0';
and added the following line:
print "<$string>\n";
When I run the script, I get back the following line:
<ll>

I get the same output when I drop the fully qualified name, as it's not needed with imported subroutines:

$string = trim ($string);

Prototypes are the ($) after subroutine names in their declarations. They tell Perl parser how to parse the arguments, they are not argument lists. If you don't know what they are and what they do, you should drop them.

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^4: Trouble usig a subroutine from a custom module
by fritz1968 (Sexton) on Nov 11, 2024 at 21:34 UTC

    To all. Thanks for your help, but I was able to figure what I was doing wrong.

    It was an ID10t error.

    In addition to the changes that choroba suggested, I realized that I had a typo in my Package.pm file. In the code that I submitted to this question, I changed around some names to mask my company and some directories for the company. In the process, I did not realize that the Package name in the .PL file was named something along the lines of :

    use customPerlMod;

    and although my file name as customPerlMod.pm, in the file itself, it was named:

    package customPerlmod;

    Note that the "m" in the package is lower case while the call to the package in the code has an upper case "M".

    Thanks for all of your help. Apologizes for my error