Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Delete space at the end of a hash element

by space_monk (Chaplain)
on Mar 26, 2013 at 12:43 UTC ( #1025514=note: print w/ replies, xml ) Need Help??


in reply to Delete space at the end of a hash element

Ye Olde Fashioned Waye.....

my %newhash; while (my ($k, $v) = each( %hash)) { $k =~ s/\s+$//; $newhash{$k} = $v; } # newhash contains correct key values
A Monk aims to give answers to those who have none, and to learn from those who know more.


Comment on Re: Delete space at the end of a hash element
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1025514]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2015-07-28 02:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (251 votes), past polls