in reply to Troubles with m!(??{substr(...)})!
1. When I changed the $_ to a numerical value inside the regex instead:
and the regex will work, without warning.if ($test =~m#(??{substr($test, 0, 8)})#) { }
2. When I set the string $test to a something numerical (12,444.343,etc.) and again it will work without warning.
3. I tried setting $_ to a number outside and again it failed.
So what I figured it dealt with the $_ So what I finally did was the following as final proof that I was on the right track:use strict; use warnings; my $test = "fee fi fo fee"; $_++; if ($test =~ m!((??{ substr($test,0,$_) }))!) { };
Which when it runs displays the following:use strict; use warnings; my $test = "fee fi fo free"; if ($test =~ m!((??{ print "$_\n";substr($test,0,$_) }))!) { };
-enlilfee fi fo free Argument "fee fi fo free" isn't numeric in substr at (re_eval 1) line +1.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Troubles with m!(??{substr(...)})!
by Zaxo (Archbishop) on Nov 21, 2002 at 02:16 UTC | |
by Enlil (Parson) on Nov 21, 2002 at 05:30 UTC | |
by BrowserUk (Patriarch) on Nov 21, 2002 at 07:18 UTC |