Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Answer: How do I call a method within a regular expression (5.004)?

by tedv (Pilgrim)
on Nov 02, 2000 at 00:28 UTC ( #39479=categorized answer: print w/replies, xml ) Need Help??

Q&A > object-oriented programming > How do I call a method within a regular expression (5.004)? - Answer contributed by tedv

I'd assume that one reason 5.005 supports ?{} is that 5.004 needed it. :) Although the object would definitly have to return a match string, right?... So if you have an object that just outputs data, the proper syntax would be:  $myobj->print() =~ /$myvar/ So you might want to/need to swap what's doing the matching on what. Of course, without context I'm not sure if this is even possible.

-Ted

  • Comment on Answer: How do I call a method within a regular expression (5.004)?
  • Download Code
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2016-12-09 06:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (148 votes). Check out past polls.