use strict; use warnings; use Data::Dumper; my $dir = '.'; my $folders = ""; opendir (DIRHANDEL, "$dir")or warn "can't open $dir\n Error: $!"; while (defined ($folders = readdir(DIRHANDEL))) { &new($folders); } closedir (DIRHANDEL); sub new { my ($folders) = @_; #my @t1 = sort $folders,[-1]; #print @t1, "\n"; print +(sort )[-1], "\n"; #print +(sort <*$folders>)[-1], "\n"; #print pop @{[sort ($folders)], "\n"}; #print $folders, "\n"; } 2.0.01.00.05 2.0.01.00.06 2.1.00.00.01 2.0.02.00.01 2.0.02.00.02