in reply to Perl variable scoping between functions
I guess you want something like this…
sub fLoadModules { my ($modules) = @_; my @stuff_to_return; open my $fh, "<", $modules or die "Couldn't open module file: $mod +ules"; while(<$fh>) { chomp; my ($module_id) = split /;/; print Dumper($module_id); push @stuff_to_return, $module_id; } close $fh; return @stuff_to_return; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl variable scoping between functions
by Bryan882 (Novice) on Jul 18, 2018 at 11:07 UTC | |
by choroba (Cardinal) on Jul 18, 2018 at 11:34 UTC | |
by Bryan882 (Novice) on Jul 18, 2018 at 11:57 UTC | |
by Corion (Patriarch) on Jul 18, 2018 at 12:07 UTC | |
by Bryan882 (Novice) on Jul 18, 2018 at 12:43 UTC | |
by tobyink (Canon) on Jul 18, 2018 at 12:56 UTC |