in reply to Re^4: Perl variable scoping between functions
in thread Perl variable scoping between functions

Have you tested fLoadModules in isolation, by passing it a hardcoded string?

I think the original problem comes from this line, which assigns $modules the number of found modules:

my $modules = fLoadModules $modules_path;

If you want to receive a list back instead of the number of modules, you need to have a list on the left hand side of the assignment:

my @modules = fLoadModules $modules_path;

Replies are listed 'Best First'.
Re^6: Perl variable scoping between functions
by Bryan882 (Novice) on Jul 18, 2018 at 12:43 UTC
    Aha! I think that this is certainly a likely cause, passing the path to the file as a hardcoded string will yield the required result so I think you are right that it could be the assignment that is incorrect.