my $open; # variable with file scope # The sub open : sub open_file {$open = $mw->getOpenFile( # no my here! ... #### sub get_statistics { ... my $fastaFile = $open; ... #### sub get_statistics { ... my $fastaFile = $current_file; ...