tye has asked for the wisdom of the Perl Monks concerning the following question:
Consider:
produces#!/usr/bin/perl -w use strict; my $match= "hi"; my $re= qr/($match)/; print "\$match is $match\n"; print "'chimp' matches (", 'chimp' =~ $re, ")\n"; $match= "lo"; print "\$match is $match\n"; print "'slow' matches (", 'slow' =~ $re, ")\n"; print "'chimp' matches (", 'chimp' =~ $re, ")\n";
So why does the qr// operator support the /o option? It already appears to only compile the regex once even without /o. - tye (but my friends call me "Tye")$match is hi 'chimp' matches (hi) $match is lo 'slow' matches () 'chimp' matches (hi)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: qr//o ... "o"??
by japhy (Canon) on Jul 11, 2001 at 22:14 UTC | |
Re: qr//o ... "o"??
by particle (Vicar) on Jul 11, 2001 at 21:49 UTC | |
Re: qr//o ...
by japhy (Canon) on Jul 11, 2001 at 21:38 UTC | |
by I0 (Priest) on Jul 14, 2001 at 13:43 UTC | |
by japhy (Canon) on Jul 14, 2001 at 18:17 UTC | |
by sierrathedog04 (Hermit) on Jul 12, 2001 at 05:43 UTC | |
by japhy (Canon) on Jul 12, 2001 at 08:07 UTC | |
Re: qr//o ... "o"??
by japhy (Canon) on Jul 14, 2001 at 18:34 UTC |
Back to
Seekers of Perl Wisdom