Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Re: Meaning of /o in Regexes

by mce (Curate)
on Dec 06, 2002 at 12:45 UTC ( #218053=note: print w/replies, xml ) Need Help??


in reply to Re: Meaning of /o in Regexes
in thread meaning of /o in regexes

Thanks, But this part I understood, it is the comparison with qr that I am puzzeled about.
---------------------------
Dr. Mark Ceulemans
Senior Consultant
IT Masters, Belgium

Replies are listed 'Best First'.
Re: Re: Re: Meaning of /o in Regexes
by slife (Scribe) on Dec 06, 2002 at 13:47 UTC

    Thanks, But this part I understood, it is the comparison with qr that I am puzzeled about.

    /o and qr// provide different services to the programmer:

    /o says 'Take this pattern and create a compiled regex that will not change for the life of the program'

    qr// says 'Take this pattern and return a special object that I can assign to a variable, interpolate into another pattern, pass to a subroutine, etc, etc, and as a side-effect creates a compiled form that I can use in pattern matches directly.'

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://218053]
help
Chatterbox?
[Lady_Aleena]: Taking the printing functionality out of a module is hard at times. The one I'm currently working on has conditionals and loops for the data to be printed.
[Lady_Aleena]: Some are as easy as returning instead of printing, but only some.
[atcroft]: Lady_Aleena: So you are shoving the disparate data into a structure and returning the structure, so you can run it through a (probably simpler) routine that displays only?

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2017-05-29 02:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?