http://qs321.pair.com?node_id=1214796


in reply to Problem using rshell to start Perl application

try FindBin

use FindBin; use lib $FindBin::Bin.'/myperl-lib'; use library_sub;
poj

Replies are listed 'Best First'.
Re^2: Problem using rshell to start Perl application
by merrymonk (Hermit) on May 17, 2018 at 21:33 UTC
    I tried this and replaced
    /myperl-lib with the actual name of the folder
    library_sub with the actual name of the Perl module that contained the subs that I wanted to call

    This partially worked but a got a number similar errors of the form
    Not enough arguments for myperl-lib::library_sub::sub name and line number in myperl-lib that has the 'our @EXPORT = (' row

      Here is a Short, Self-Contained, Correct Example for you to try and then adapt to your situation and hopefully demonstrate the problem.

      #!perl # c:/path/to/dirapp/test.pl use strict; use warnings; use FindBin; use lib $FindBin::Bin.'/myperl-lib'; use library_sub; print test();
      package library_sub; # c:/path/to/dirapp/myperl-lib/library_sub.pm use strict; use warnings; use Exporter qw(import); our @EXPORT = ( 'test' ); sub test { return "library_sub::test - OK"; } 1;
      poj