Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Extending Array

by jandrew (Chaplain)
on Mar 21, 2012 at 15:12 UTC ( #960786=note: print w/replies, xml ) Need Help??


in reply to Extending Array

An a additional possibility is to turn the HashRef into a hash variable and call a hash slice to add the next two key / value pairs. Read the perlvar detail on $; for more information

#!/usr/bin/perl use strict; use warnings; my $thing = { 'A' => 'hello', 'B' => 'there' }; #use a hash slice @$thing{'C', 'D'} = ('cutie', 'pie'); print "$thing->{'A'} $thing->{'B'} $thing->{'C'} $thing->{'D'}\n";

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://960786]
help
Chatterbox?
[karlgoethebier]: now it's getting weird...
[GotToBTru]: 'getting'?
[Discipulus]: why karlgoethebier ?
[GotToBTru]: ugh .. what's the term for comparing versions of an algorithm to determine which is most efficient?
[hippo]: Benchmarking?
[GotToBTru]: hippo++

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (12)
As of 2017-06-22 12:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (519 votes). Check out past polls.