#!/usr/bin/perl # http://perlmonks.org/?node_id=1188504 use strict; use warnings; my %hash = qw( title1 1 title3 3 title4 4 title2 2 ); my @labels = sort keys %hash; my @content = @hash{@labels}; use Data::Dumper; print Dumper \%hash; print "\n"; print Dumper \@labels; print "\n"; print Dumper \@content;
In reply to Re: Transferring hash keys to array... Need help sorting
by tybalt89
in thread Transferring hash keys to array... Need help sorting
by DARK SCIENTIST
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |