New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
invalid regexp in perl -V #6806
Comments
From Robin.Barker@npl.co.ukCreated by robin.barker@npl.co.ukThis is an issue with C<config_re> in Config.pm % perl -V:'?flags' It works because the regexp used in config_re become Is this a neat feature, or should the -V:regexp only I have a patch for the latter case [attached]. Robin Perl Info
|
From @ysthOn Wed, 1 Oct 2003, Robin Barker wrote:
I think it would be sufficient for configpm to wrap a (?: ) |
From @rgsYitzchak Scott-Thoennes wrote:
Reminds me this old japh : |
From ams@wiw.org(Just for the record: I don't think anything needs to be changed here.) -- ams |
From @ysthOn Mon, Oct 06, 2003 at 10:13:39AM +0530, Abhijit Menon-Sen <ams@wiw.org> wrote:
I think perl should complain about Robin Barker's original case: perl -V:'?flags' Not having actually submitted a patch of my own, I'd much rather see |
From Robin.Barker@npl.co.ukIn an attempt to close #24081, here is a simplified patch. Robin --- configpm.orig Sun Nov 16 17:26:58 2003 sub config_re { sub config_vars { -plan tests => 36; use_ok('Config'); @@ -77,10 +77,15 @@ +Config::config_vars('?flags'); like($out1, qr/^cc='\Q$Config{cc}\E';/, "config_vars cc"); # Read-only. This e-mail and any attachments may contain confidential and/or NPL Management Ltd cannot guarantee that the e-mail or any NPL Management Ltd. Registered in England and Wales. No: 2937881 |
From Robin.Barker@npl.co.ukconfig_re.patch--- configpm.orig Sun Nov 16 17:26:58 2003
+++ configpm
@@ -329,7 +329,7 @@
sub config_re {
my $re = shift;
- return map { chomp; $_ } grep /^$re=/, split /^/, $Config_SH;
+ return map { chomp; $_ } grep eval{ /^(?:$re)=/ }, split /^/, $Config_SH;
}
sub config_vars {
--- lib/Config.t.orig Fri Mar 14 11:50:25 2003
+++ lib/Config.t
@@ -6,7 +6,7 @@
require "./test.pl";
}
-plan tests => 36;
+plan tests => 37;
use_ok('Config');
@@ -77,10 +77,15 @@
my $out2 = $$out;
$out->clear;
+Config::config_vars('?flags');
+my $out3 = $$out;
+$out->clear;
+
untie *STDOUT;
like($out1, qr/^cc='\Q$Config{cc}\E';/, "config_vars cc");
like($out2, qr/^d_bork='UNKNOWN';/, "config_vars d_bork is UNKNOWN");
+like($out3, qr/: not found$/, "config_vars with invalid regexp");
# Read-only.
|
From @rgsRobin Barker wrote:
Your patch (with the necessary adjustments) causes several regression
|
From @tamiasOn Wed, Jun 09, 2004 at 12:02:01PM +0100, Robin Barker wrote:
Is the intent that this regex throws an error in the eval, or just that it Ronald |
From @rgsRonald J Kimball wrote:
in this test that's actually /?flags/ used as an ivalid regexp, a few lines earlier. $ perl -ce '/?flags/' |
From Robin.Barker@npl.co.ukThe intent is that My earlier patch reverse the intent of (2): an invalid regexp The problems with doing something with the error from the eval Robin -----Original Message----- On Wed, Jun 09, 2004 at 12:02:01PM +0100, Robin Barker wrote:
Is the intent that this regex throws an error in the eval, or just that it Ronald This e-mail and any attachments may contain confidential and/or NPL Management Ltd cannot guarantee that the e-mail or any NPL Management Ltd. Registered in England and Wales. No: 2937881 |
From @rgsRobin Barker wrote:
Thanks, applied as #22921 with the further ajustments you made for |
@rgs - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#24081 (status was 'resolved')
Searchable as RT24081$
The text was updated successfully, but these errors were encountered: