Or using map function, with hdb data like so:
use warnings; use strict; use Data::Dumper; my %hash = ( "apples " => 4, "oranges " => 5 ); %hash = map { my $val = $hash{$_}; s/\s+$//; $_, $val } keys %hash; print Dumper \%hash;
In reply to Re: Delete space at the end of a hash element
by 2teez
in thread Delete space at the end of a hash element
by Dr Manhattan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |