Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^9: Capturing regex from map

by Anonymous Monk
on Sep 16, 2013 at 06:06 UTC ( #1054228=note: print w/replies, xml ) Need Help??


in reply to Re^8: Capturing regex from map
in thread Capturing regex from map

I'm saying that it can, for the OP's case, be trivially made easier to understand. It did take me a few minutes' head-scratching to see what it did, and it surprised me that the community's response about its clarity was positive.

In my case, I don't use the list-returning properties of regexps often, nor do I expect map to subtract from or add to the amount of elements in the array. If I need to kill elements, I generally leave a hint such as () inside the map block.

I do not view this behaviour as dumbing down code at all, but just saving people's heads from excess scratching, that they are able to instantly see what that line does. The Perl community does have a reputation of abstruse write-only code, you know, and I think this line would be a perfect example of excess terseness the community is infamous for. (For the record, I hate Java for its dumb verbosity. Middle grounds exist, too.)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (1)
As of 2023-06-01 05:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?