Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://517462]
[ovedpo15]: can't I use just use lib $FindBin::Bin/../ bin" asuming that p2 is in ./bin and p1 is in /config? it says "cant find" altought p2 is
[moritz]: ovedpo15 "use lib" is only for .pm files
[moritz]: if you don't have .pm file, you might to use "require" or "do" with an absolute path
[ovedpo15]: I need to use FindBin thought. does FindBin finds only modules? or it can find perl script also?

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2018-03-17 20:47 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (226 votes). Check out past polls.