Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Using map to create a hash/bag from an array

by GrandFather (Sage)
on Dec 17, 2005 at 10:41 UTC ( #517462=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    my %hash;
    @hash{qw(a b c)} = (1) x 3;
    print Dumper (\%hash);
    
  2. or download this
    $VAR1 = {
              'c' => 1,
              'a' => 1,
              'b' => 1
            };
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://517462]
help
Chatterbox?
[choroba]: LanX: That's the heritage, I can't do anything else
[RonW]: Sounds like some system my employer has "It does exactly what we need it to do and can't afford to risk anything we can't prove is 100% compatible"
[marto]: choroba sounds interesting
[RonW]: james28909 Why not write a Perl program to do the task?
[choroba]: RonW Yes, but then, one day, they needed to switch from FTP to SFTP, and... but I can't give the whole talk away here :)
[RonW]: Tunnel FTP through stunnel?

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (10)
As of 2017-05-22 21:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?