On Sun, Mar 15, 2009 at 12:33 AM, Mikhael Goikhman wrote: > > /.../ evaluates regular expression, and qr/.../ operator returns > something between a regular string and an object. Read "perldoc perlop" > under Regexp Quote-Like Operators section. >
To be precise (well pedantic tbh :)), both the "m/.../" and the "qr/.../" are operators. However as Michael wrote, they do very different things - m/.../ actually runs Perl's RE engine, evaluating the regexp. Even without the binding operator, the regexp inside the operator will be interpreted. In contrast, all qr/.../ does(*) is quote the regexp - not much differently from using double-quotes or the qq/.../ operator - and return the quoted form. This "quoted form" will be evaluated when you actually use it in matching or substitution operation. (*) "It magically differs from a string containing the same characters" to quote the documentation. Cheers, -- Offer Kaye _______________________________________________ Perl mailing list [email protected] http://perl.org.il/mailman/listinfo/perl
