for my $datei( @dateien ){ my ($func,$param) = @ARGV; if( $func eq '-s' and index($datei,$param) != -1 ){ print $datei; } }