sub open_file {my $open = $mw->getOpenFile(-filetypes => $types_OPEN, -defaultextension => '.sff'); $read_fh = IO::File->new("$open",'r'); read_text($read_fh); } sub read_text { local $read_fh = shift; my @lines; @lines = <$read_fh>; print @lines; MainLoop }