#!/usr/bin/perl use strict; use warnings; use File::Find::Rule; # suche alle cluster-Dateien my @files = File::Find::Rule->file->name( "cluster*_gaf.txt" )->maxdepth(1)->in( '.' ); # sortiere mittels "Schwartzsche Transformation" my @sorted = map{ $_->[0] } sort{ $a->[1] <=> $b->[1] } map{ my ($i) = $_ =~ /cluster(\d+)/; [ $_, $i ] } @files; print $_,"\n" for @sorted;