I am attepting to pass an optional anonymous hash as the first argument to a function. I allow any case for the keys and values. I then convert the hash in the hash reference to all lowercase. I have isolated the method I am using to this small script. My question is: Is there a way to convert the keys and values of a hash to all lowercase without using a temporary hash? (I realize this will change the original hash.)
#!/usr/bin/perl
use strict;
use diagnostics;
use Data::Dumper;
my $hash_ref = { Extension => '.txt',
Content => 'text',
Directory => 'c:/' };
print Dumper $hash_ref;
my %lc_hash;
$lc_hash{lc $_[0]} = lc $_[1] while @_ = each %$hash_ref;
$hash_ref = \%lc_hash;
print Dumper $hash_ref;
__END__
Thank You,
Charles K. Clarkson