Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: How to force list context?

by choroba (Cardinal)
on Dec 08, 2014 at 11:14 UTC ( [id://1109549]=note: print w/replies, xml ) Need Help??


in reply to (Answered) How to force list context?

You can use a hash slice with only one key:
@h{ /\w$/g } += $_ while <DATA>;

But I find it quite ugly. What about split?

$h{ (split)[1] } += $_ while <DATA>;
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^2: How to force list context?
by rsFalse (Chaplain) on Dec 08, 2014 at 11:19 UTC
    Thanks!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-04-23 21:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found