Does anyone know for sure.
Thanks in advance
5.6.0.
$ /opt/perl/5.005_04/bin/perl -wle '"foo" =~ /o/g; print scalar @-'
0
$ /opt/perl/5.6.0/bin/perl -wle '"foo" =~ /o/g; print scalar @-'
1
Abigail
--
perl -swleprint -- -_=Just\ another\ Perl\ Hacker
>
> $ /opt/perl/5.005_04/bin/perl -wle '"foo" =~ /o/g; print scalar @-'
> 0
> $ /opt/perl/5.6.0/bin/perl -wle '"foo" =~ /o/g; print scalar @-'
> 1
>
Ummm ... does the 'g' switch have some application in a "matching" (as
opposed to "substituting") regular expression ? ... or is that simply a typo
?
I find the 'g' switch, used like that, is producing some very weird results.
For example, whilst that one liner outputs '1' for me, the following script
outputs '808482909':
use warnings;
"foo" =~ /o/g;
print scalar @-;
If I don't 'use warnings;' in that script, it reverts to outputting '1'.
Cheers,
Rob
It doesn't matter whether /g is used or not.
)) I find the 'g' switch, used like that, is producing some very weird results.
)) For example, whilst that one liner outputs '1' for me, the following script
)) outputs '808482909':
))
)) use warnings;
)) "foo" =~ /o/g;
)) print scalar @-;
))
)) If I don't 'use warnings;' in that script, it reverts to outputting '1'.
I can't reproduce that with any version of Perl that supports @-.
Abigail
--
$_ = "\x3C\x3C\x45\x4F\x54";
print if s/<<EOT/<<EOT/e;
Just another Perl Hacker
EOT
>> use warnings;
>> "foo" =~ /o/g;
>> print scalar @-;
>>
>> If I don't 'use warnings;' in that script, it reverts to
>> outputting '1'.
>
> I can't reproduce that with any version of Perl that supports @-.
perl, v5.8.6 built for i386-freebsd-64int
$ perl -e 'use strict; use warnings; "foo" =~ /o/g; print scalar @-'
134641065
$ perl -e 'use warnings; "foo" =~ /o/g; print scalar @-'
134621613
$ perl -e '"foo" =~ /o/g; print scalar @-'
1
Without the g-modifier they all print '1'.
--
Affijn, Ruud
"Gewoon is een tijger."
>
> )) I find the 'g' switch, used like that, is producing some very weird
results.
> )) For example, whilst that one liner outputs '1' for me, the following
script
> )) outputs '808482909':
> ))
> )) use warnings;
> )) "foo" =~ /o/g;
> )) print scalar @-;
> ))
> )) If I don't 'use warnings;' in that script, it reverts to outputting
'1'.
>
>
> I can't reproduce that with any version of Perl that supports @-.
>
Sorry - I meant to specify that I was using perl 5.8.7 on Win32.
The following script just hangs forever (with no output), then segfaults
when I kill the script (with Ctrl-C):
use warnings;
$foo = 'ffooooo';
$foo =~ /o/g;
print "@-";
I don't think it's critical since removal of the 'g' modifier solves the
problem. Should I file a bug report about this ?
Cheers,
Rob
I am not sure what's going on, but I don't observe that behavior with
D:\Home\asu1\UseNet\clpmisc> perl -v
This is perl, v5.8.7 built for MSWin32-x86-multi-thread
(with 14 registered patches, see perl -V for more detail)
Copyright 1987-2005, Larry Wall
Binary build 815 [211909] provided by ActiveState
http://www.ActiveState.com
ActiveState is a division of Sophos.
Built Nov 2 2005 08:44:52
D:\Home\asu1\UseNet\clpmisc> cat r.pl
use warnings;
$foo = 'ffooooo';
$foo =~ /o/g;
print "@-";
D:\Home\asu1\UseNet\clpmisc> r
2
--
A. Sinan Unur <1u...@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)
comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
>
> D:\Home\asu1\UseNet\clpmisc> perl -v
>
> This is perl, v5.8.7 built for MSWin32-x86-multi-thread
> (with 14 registered patches, see perl -V for more detail)
>
> Copyright 1987-2005, Larry Wall
>
> Binary build 815 [211909] provided by ActiveState
> http://www.ActiveState.com
> ActiveState is a division of Sophos.
> Built Nov 2 2005 08:44:52
>
> D:\Home\asu1\UseNet\clpmisc> cat r.pl
> use warnings;
> $foo = 'ffooooo';
> $foo =~ /o/g;
> print "@-";
>
>
> D:\Home\asu1\UseNet\clpmisc> r
> 2
>
You're right - ActiveState's build 815 seems immune to the problem. However,
their build 810 (perl 5.8.4) *does* suffer this strange affliction, as does
my MinGW-built perl 5.8.7, and my VC++7.0-built perl 5.8.7. I'll wait and
see what perl 5.8.8 brings.
Cheers,
Rob
>
> You're right - ActiveState's build 815 seems immune to the problem.
Hi,
I run exactly the same AS-build :
perl -v
This is perl, v5.8.7 built for MSWin32-x86-multi-thread
(with 14 registered patches, see perl -V for more detail)
Copyright 1987-2005, Larry Wall
Binary build 815 [211909] provided by ActiveState http://www.ActiveState.com
ActiveState is a division of Sophos.
Built Nov 2 2005 08:44:52
use warnings;
$foo = 'ffooooo';
$foo =~ /o/g;
print "@-";
does not return as described by Rob.
It prints 2 as expected if I don't use warnings.
--
please reply to
perl -e "print scalar reverse q/ed....@thcerpmal.hpotsirhc/"
> ActiveState's build 815 seems immune to the problem.
> However, their build 810 (perl 5.8.4) *does* suffer this strange
> affliction, as does my MinGW-built perl 5.8.7, and my VC++7.0-built
> perl 5.8.7. I'll wait and see what perl 5.8.8 brings.
Are these all on the same machine?
Sinan
Yes.
Abigail
--
perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'
That's a bug, and something I can't reproduce under Linux.
You ought to file a bugreport.
Abigail
--
$_ = "\x3C\x3C\x45\x4F\x54"; s/<<EOT/<<EOT/e; print;
I can (Debian sid). It seems locale dependent, see
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=350377
--
BZ
Yes - on the same Windows 2000 box.
I'm wondering whether build 815 incorporates a patch that addresses this
isuue. With ActiveState perl, 'perl -V' lists the patches that have been
applied, but I can't see anything listed there (see below) that looks like
it might have fixed this particular problem. Of course, the fix might have
been applied in build 814 or 813 ... but I don't know how to find out which
patches were applied to those builds (unless I actually install those 2
builds and run 'perl -V' :-)
I'll make some further enquiries on the perl-win32-users list hosted by
ActiveState. Someone there might be able to point me to more definitive
information.
Here are the patches listed for build 815:
Locally applied patches:
ActivePerl Build 815 [211909]
Iin_load_module moved for compatibility with build 806
PerlEx support in CGI::Carp
Less verbose ExtUtils::Install and Pod::Find
instmodsh upgraded from ExtUtils-MakeMaker-6.25
Patch for CAN-2005-0448 from Debian with modifications
Upgrade to Time-HiRes-1.76
25774 Keys of %INC always use forward slashes
25747 Accidental interpolation of $@ in Pod::Html
25362 File::Path::mkpath resets errno
25181 Incorrect (X)HTML generated by Pod::Html
24999 Avoid redefinition warning for MinGW
24699 ICMP_UNREACHABLE handling in Net::Ping
21540 Fix backward-compatibility issues in if.pm
Cheers,
Rob
perl, v5.8.7 built for cygwin-thread-multi-64int
$ perl -e 'use strict; use warnings; "foo" =~ /o/g; print scalar @-'
1628668893
$ perl -e 'use warnings; "foo" =~ /o/g; print scalar @-'
35
$ perl -e '"foo" =~ /o/g; print scalar @-'
1
perl, v5.8.7 built for MSWin32-x86-multi-thread (ActivePerl build 815)
C:\>perl -e "use strict; use warnings; 'foo' =~ /o/g; print scalar @-"
27651977
C:\>perl -e "use warnings; 'foo' =~ /o/g; print scalar @-"
786437
C:\>perl -e "'foo' =~ /o/g; print scalar @-"
1
--
>
> "A. Sinan Unur" <1u...@llenroc.ude.invalid> wrote in message
> news:Xns975A62FF4572...@127.0.0.1...
>> "Sisyphus" <sisy...@nomail.afraid.org> wrote in
>> news:43dc85d3$0$5922$afc3...@news.optusnet.com.au:
>>
>> > ActiveState's build 815 seems immune to the problem.
>> > However, their build 810 (perl 5.8.4) *does* suffer this strange
>> > affliction, as does my MinGW-built perl 5.8.7, and my VC++7.0-built
>> > perl 5.8.7. I'll wait and see what perl 5.8.8 brings.
>>
>> Are these all on the same machine?
>>
>
> Yes - on the same Windows 2000 box.
> I'm wondering whether build 815 incorporates a patch that addresses
> this isuue. With ActiveState perl, 'perl -V' lists the patches that
> have been applied, but I can't see anything listed there (see below)
> that looks like it might have fixed this particular problem. Of
> course, the fix might have been applied in build 814 or 813 ... but I
> don't know how to find out which patches were applied to those builds
> (unless I actually install those 2 builds and run 'perl -V' :-)
http://aspn.activestate.com/ASPN/docs/ActivePerl/5.8/changes-58.html
Hope this helps.
>
>
> perl, v5.8.7 built for MSWin32-x86-multi-thread (ActivePerl build 815)
>
> C:\>perl -e "use strict; use warnings; 'foo' =~ /o/g; print scalar @-"
> 27651977
> C:\>perl -e "use warnings; 'foo' =~ /o/g; print scalar @-"
> 786437
> C:\>perl -e "'foo' =~ /o/g; print scalar @-"
> 1
>
Aaah, so AS build 815 *is* afflicted (I get the same) - but not in the same
way as my other builds. I'll file a bug report now.
Cheers,
Rob
>> but I
> > don't know how to find out which patches were applied to those builds
> > (unless I actually install those 2 builds and run 'perl -V' :-)
>
> http://aspn.activestate.com/ASPN/docs/ActivePerl/5.8/changes-58.html
>
Thanks for the link (which I've saved). Couldn't really see anything that
would explain the change in behaviour.
Dr.Ruud has just pointed out that build 815 is afflicted - though in
not-quite-the-same-way as my other builds, so I'll file a bug report.
Cheers,
Rob
It is a little crazy ... I tried the cases he posted, and I get
something different (with the same AS Perl):
C:\opt> perl -e "use warnings; 'foo' =~ /o/g; print scalar @-"
262152
C:\opt> perl -e "use strict; use warnings; 'foo' =~ /o/g; print scalar
@-"
1
C:\opt> perl -e "'foo' =~ /o/g; print scalar @-"
1
Anyway, a bug report is probably the best way to go at this point.
Thank you.
>
> Anyway, a bug report is probably the best way to go at this point.
>
For anyone interested, the perlbug auto-reply informs me that my ticket has
been assigned an ID of [perl #38363].
Cheers,
Rob
> Aaah, so AS build 815 *is* afflicted [...]
> I'll file a bug report now.
OK, thanks.