#......All the menu items are not showed in the code, only the part of interest.....: # OPEN FILE $file->command( -label => 'Open', -accelerator => 'Ctrl-o', -underline => 0, -command => \&open_file); $mw->bind('', [\&open_file]); #SUPPORTED FILES TO OPEN my $types_OPEN = [ ['SFF files', '.sff'], ['All Files', '*'],]; 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 { my @lines; @lines = <$read_fh>; my $mw = MainWindow->new(-title=>'Colored Text'); $mw => print @lines; MainLoop }