Chas Owens wrote:
qr// is just a fancy double
quote that adds a non-capturing group and sets the appropriate options
(in case you did something like qr/foo/i).  The string "(?:-xism:foo)"
is no more or less a regex than the string "foo".

Let's look into that.

C:\home>type test.pl
$re1 = '(?i-xsm:foo)';
$re2 = qr(foo)i;
foreach ($re1, $re2) {
    print $_, "\n";
    if ( $ret = ref $_ ) {
        print "Scalar variabel type: $ret\n\n";
    } else {
        print "Scalar variabel type: plain string\n\n";
    }
}

C:\home>perl test.pl
(?i-xsm:foo)
Scalar variabel type: plain string

(?i-xsm:foo)
Scalar variabel type: Regexp


C:\home>

Apparently there is more into it; maybe it has something to do with qr// compiling the string that is passed to the operator.

http://perldoc.perl.org/perlop.html#qr%2fSTRING%2fimosx-qr-%2fi-%2fm-%2fo-%2fs-%2fx

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to