Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1054228]
[Tanktalus]: Without confusion, I'd be out of a job ;)
[Tanktalus]: Already. :D
[Lady_Aleena]: Your Mother, I wish it did have a way to put in a directory to search.
[Your Mother]: Thatís silly. Itís a string op tool.
[Lady_Aleena]: So I guess I'll go argue with File::Find and grep.
[Your Mother]: I would probably use Path::Tiny instead for it's slurp and such.
[Your Mother]: s/it's/its/

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2017-05-23 19:39 GMT
Find Nodes?
    Voting Booth?