Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Delete space at the end of a hash element

by vinoth.ree (Monsignor)
on Mar 26, 2013 at 11:06 UTC ( #1025501=note: print w/replies, xml ) Need Help??


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

Update:

Oops!!! I have given script to remove white spaces from values of hash...

I want to delete all the spaces at the end of each element

use strict; use warnings; use Data::Dumper; my %var_h =(1 => " value", "2" => "two "); s/(\s+)$//g for values %var_h; print Dumper \%var_h;

The element should only consist of characters, no spaces at all.

use strict; use warnings; use Data::Dumper; my %var_h =(1 => " value", "2" => "two "); s/\s+//g for values %var_h; print Dumper \%var_h;

All is well

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1025501]
help
Chatterbox?
[Discipulus]: why github use 'pull request' instead of 'push request'? where is the subject?
[Discipulus]: I'm the subject or is the program? i think i always am the subject
[erix]: it an invite to pull, as I understand it
[Discipulus]: Concave or convex?
[Discipulus]: who make the invitation? the program?!?
[choroba]: it's historical
[erix]: pull requests
[choroba]: originally, you sent a pull request to someone by email, i.e. you asked them to pull from your repo
[Discipulus]: if is the author of a patch, is more like a 'request to push' into rather than a pull request..
[choroba]: as it's considered unpolite to push to someone else's repo

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2017-05-27 20:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?