Smitty said:
I can't find any reference to 'cooking' regular expressions in any of
my three perl books (Llama, Camel, Panther).
Such such a thing exist, and if so, should I worry about 'raw' regex's
Let's see if I follow you correctly first. In some languages (notably C),
there's a separate regex library. In those languages you have to call a
function that takes a regex pattern as a string (a "raw" regex), and returns
a pointer to a structure containing the "cooked" (compiled) regex, which is
essentially a representation of a finite state machine. Then you run that
state machine against one or more strings to perform the matching operation.
If that's what you're referring to, then no - In Perl, you don't need to
worry about it, for the most part. The whole process of compiling regex
string patterns into finite state machines is handled behind the scenes,
so you rarely even need to be aware of it.
This is, in fact, a standout feature of the language - some other languages
are catching up recently, but Perl has had smooth integration of regular
expressions into the core language from the beginning.
If you're curious, have a look at "perldoc perlop", in the section "Gory
details of parsing quoted constructs". It has some details about how "raw"
regexes are handled, and how you can get a look at the "cooked" results.
sherm--