in reply to Delete space at the end of a hash element
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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Delete space at the end of a hash element
by hdb (Monsignor) on Mar 26, 2013 at 09:33 UTC |