dcorbin has asked for the wisdom of the Perl Monks concerning the following question:
executing this produces#!/usr/bin/perl my $html = qq( abcdef ); sub check { my $pattern = shift; my @br; eval "\@br = ' abcdef ' =~ m/$pattern/x"; die "$@\n" if $@; print "PATTERN=m/$pattern/x\n"; print "ANSWER = "; print join("-",@br),"\n"; } check('(?-x:(abcdef))'); check('(?-x:(abcdef)) # comment here');
PATTERN=m/(?-x:(abcdef))/x ANSWER = abcdef PATTERN=m/(?-x:(abcdef)) # comment here/x ANSWER =I think both check's should produce the same results. Am I right or wrong?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: codem/(?:-x pattern) #comment /x bug?/code
by Shendal (Hermit) on Sep 08, 2000 at 00:08 UTC | |
by Fastolfe (Vicar) on Sep 08, 2000 at 00:15 UTC | |
by dcorbin (Sexton) on Sep 08, 2000 at 00:13 UTC | |
|
(Ovid) Re: codem/(?:-x pattern) #comment /x bug?/code
by Ovid (Cardinal) on Sep 08, 2000 at 00:07 UTC | |
by dcorbin (Sexton) on Sep 08, 2000 at 00:11 UTC | |
|
Re: codem/(?:-x pattern) #comment /x bug?/code
by Hot Pastrami (Monk) on Sep 08, 2000 at 00:04 UTC | |
by dcorbin (Sexton) on Sep 08, 2000 at 00:06 UTC |