... what if the content for each element of that array is a string of characters and not numeric?
One interpretation:
(BTW: This is something you could actually have tried for yourself!)c:\@Work\Perl\monks>perl -wMstrict -le "use Data::Dump qw(dd); ;; my %hash = qw(title1 uno title3 tres title4 quatro title2 dos); ;; my @labels = sort keys %hash; my @content = @hash{@labels}; ;; dd \%hash; dd \@labels; dd \@content; " { title1 => "uno", title2 => "dos", title3 => "tres", title4 => "quatr +o" } ["title1", "title2", "title3", "title4"] ["uno", "dos", "tres", "quatro"]
Update: The @hash{@labels} thing is a hash slice.
Give a man a fish: <%-{-{-{-<
In reply to Re^3: Transferring hash keys to array... Need help sorting
by AnomalousMonk
in thread Transferring hash keys to array... Need help sorting
by DARK SCIENTIST
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |