in reply to Re: Regex result being defined when it shouldn't be(?)
in thread Regex result being defined when it shouldn't be(?)
P.s. the reason I'm doing this manually is because I'm making it as portable as possible and sensible to me. I'm running Perl on Windows 7/8/10, modern Linux, a Debian 2.6.32, etc. Production environment with too many distributions, internal/external network, all that jazz. I already had an issue where a CPAN module I would've liked had some Linux-only make commands.use strict; use warnings; my $string = "string"; if( $string m/([5]?)string/ ){ print "? inside group: $1\n"; #prints fine } if( $string m/([5])?string/ ){ print "? outside group: $1\n"; #Use of uninitialized value $1 in c +oncatenation (.) or string... } return 0;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Regex result being defined when it shouldn't be(?)
by haukex (Archbishop) on Nov 14, 2017 at 16:40 UTC | |
|
Re^3: Regex result being defined when it shouldn't be(?)
by pryrt (Abbot) on Nov 14, 2017 at 16:42 UTC | |
by haukex (Archbishop) on Nov 14, 2017 at 16:55 UTC | |
by chenhonkhonk (Acolyte) on Nov 14, 2017 at 17:01 UTC | |
by haukex (Archbishop) on Nov 14, 2017 at 17:50 UTC | |
by chenhonkhonk (Acolyte) on Nov 15, 2017 at 15:07 UTC | |
by haukex (Archbishop) on Nov 15, 2017 at 20:22 UTC | |
by pryrt (Abbot) on Nov 15, 2017 at 16:53 UTC | |
|