Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^3: Capturing regex from map

by BrowserUk (Pope)
on Sep 13, 2013 at 17:34 UTC ( #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.


Comment on Re^3: Capturing regex from map
Re^4: Capturing regex from map
by LanX (Canon) 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
Node Status?
node history
Node Type: note [id://1053973]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2014-12-27 03:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls