Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Assign (key, value) to a hash w/o clobbering hash

by rjray (Chaplain)
on Sep 28, 2006 at 08:34 UTC ( #575305=note: print w/replies, xml ) Need Help??


in reply to Assign (key, value) to a hash w/o clobbering hash

How about:

@X_delimited_strings = qw(fooXbar bishXbash); for (@X_delimited_strings) { @_ = split /X/; $hash{$_[0]} = $_[1]; }

You will have to accept a temp variable somewhere. You can use those already available to you (like $_ and @_) or declare your own.

--rjray

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2022-05-22 02:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (78 votes). Check out past polls.

    Notices?