Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Syntax for casting map to a hash or an array

by haukex (Bishop)
on Apr 05, 2017 at 15:50 UTC ( #1187148=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    print Dumper @{ [ map {"<$_>"} qw/a b c/ ] };
    __END__
    $VAR1 = '<a>';
    $VAR2 = '<b>';
    $VAR3 = '<c>';
    
  2. or download this
    sub foo { return "World!" }
    print "Hello, ", foo(), "\n";   # prints "Hello, World!"
    print "Hello, foo()!\n";        # prints "Hello, foo()!"
    print "Hello, @{[ foo() ]}\n";  # prints "Hello, World!"
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2020-12-02 17:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you use taint mode?





    Results (44 votes). Check out past polls.

    Notices?