in reply to Returning data from a sub routine in a module.

You didn't show how you assigned anything to @data in your .pm file. When I fill @data, I get the expected output:
sub results { my @data = 1..5; my $results = \@data; return $results; }

Replies are listed 'Best First'.
Re^2: Returning data from a sub routine in a module.
by Anonymous Monk on Apr 19, 2016 at 19:45 UTC
    I didn't because I just want to make sure I am calling the sub in the module from the perl script the correct way. I my code if I do a print Dump inside of the module's sub I get data but as I asked, from the Perl file it returns an empty value. So you are saying since you added data the code I posted is correct?