@arrayUnsorted=('page1.html', 'page11.html', 'page2.html', 'page3.html'); #### @arraySorted=('page1.html', 'page2.html', 'page3.html', 'page11.html'); #### opendir my $dir, "." or die "Cannot open directory: $!"; my @files = readdir $dir; my @filesHTML; foreach (@files){ if ($_ =~ /html/) { push @filesHTML, $_; } }