foreach $table_name ((sort { $a cmp $b } @table_list)[2..$#table_list]) { # do stuff }