How large will @$vars be? If larger than a hundred elements or so, you will benefit from a Schwartzian transform:
my @sorted_vars = map { $_->[1] } sort { $a->[0] cmp $b->[0] } map { [ lc $_, $_ ] } @{$vars};
I'm afraid I'm as out of ideas as the other posters here -- your only recourse is to use a profiler and find the bottlenecks that way.
In reply to Re^3: Speed up hash initialization loop
by Anonymous Monk
in thread Speed up hash initialization loop
by austinj
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |