in reply to Copy hash's key to an array

The Perl built-in keys function does this:
my @keys = keys %hash;
Perl comes with documentation which can be queried from the command line:
perldoc -q keys