Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^3: Capturing regex from map

by BrowserUk (Patriarch)
on Sep 13, 2013 at 17:34 UTC ( [id://1053973]=note: print w/replies, xml ) Need Help??


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

Why did you wonder why I wondered?

Because most times when this kind of question -- someone second guessing a piece of working code -- comes up, there is usually some clue, either in the post, or in the history of this place, to indicate what the fear that underlies the question is.

With your question I detect nothing that indicates either a commonly frowned upon, but otherwise workable construct -- as we often see with map in a scalar or void context for example -- nor anything in your post to indicate the basis of your doubts.

I cannot see any reason not to use the construct for those occasions when it does the required task. It is concise and to my eyes clear. But, there is the possibility that I'm missing something, hence I wanted to know more ...


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^4: Capturing regex from map
by LanX (Saint) on Sep 13, 2013 at 17:45 UTC
    > It is concise and to my eyes clear.

    well, as you can see from some answers it's not clear for everybody.

    you are using the fact that 'm//' in list context returns a list of the grouped matches (if any).

    (w/o grouping it returns 1 for true matches)

    If you are using this idiom very often you might want to document it for other maintainers...

    Cheers Rolf

    ( addicted to the Perl Programming Language)

      you are using

      I'm not using anything, but if I were called upon to maintain the OPs code; *I* would not have a problem with it.

      Try addressing your pedantry to the OP. He might be interested.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
        Strange, I thought I was replying to the OP ... nevermind!

        Cheers Rolf

        ( addicted to the Perl Programming Language)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-03-28 19:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found