#!/usr/bin/perl use strict; use warnings; use Tk; my $path; my $mw = tkinit(); $mw->Entry(-textvariable => \$path)->pack(); $mw->Button(-command => \&search_file, -text => 'Datei wählen')->pack(); MainLoop; sub search_file{ my @filetypes = (['All Images', ['.GIF','.XBM','.XPM','.BMP']], ['All Images',['.PNG','.PPM','.PGM','.JPEG','.JPG']],); $path = $mw->getOpenFile(-filetypes => \@filetypes); }