Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

When were @- and @+ added

2 views
Skip to first unread message

karl williamson

unread,
Jan 26, 2006, 11:42:12 PM1/26/06
to
I look in the various perldelta documentations, and see only that the
English synonyms were added in 5.7.0. Someone in a news group said they
were added in 5.6. Is this true, which would mean that they weren't
documented in the perldeltas. Or maybe they've been there since 5.003,
but weren't in the Camel book 2nd Edition.

Does anyone know for sure.

Thanks in advance

Abigail

unread,
Jan 27, 2006, 2:12:07 PM1/27/06
to
karl williamson (con...@khwilliamson.com) wrote on MMMMDXXXII September
MCMXCIII in <URL:news:11tj954...@corp.supernews.com>:
== I look in the various perldelta documentations, and see only that the
== English synonyms were added in 5.7.0. Someone in a news group said they
== were added in 5.6. Is this true, which would mean that they weren't
== documented in the perldeltas. Or maybe they've been there since 5.003,
== but weren't in the Camel book 2nd Edition.
==
== Does anyone know for sure.


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

Sisyphus

unread,
Jan 28, 2006, 7:00:34 PM1/28/06
to

"Abigail" <abi...@abigail.nl> wrote in message

>
> $ /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


Abigail

unread,
Jan 28, 2006, 8:00:46 PM1/28/06
to
Sisyphus (sisy...@nomail.afraid.org) wrote on MMMMDXXXIV September
MCMXCIII in <URL:news:43dc0632$0$23262$afc3...@news.optusnet.com.au>:
))
)) "Abigail" <abi...@abigail.nl> wrote in message
))
)) >
)) > $ /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
)) ?

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

Dr.Ruud

unread,
Jan 28, 2006, 8:20:52 PM1/28/06
to
Abigail schreef:
> Sisyphus:

>> 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."

Sisyphus

unread,
Jan 29, 2006, 2:51:41 AM1/29/06
to

"Abigail" <abi...@abigail.nl> wrote in message

>


> )) 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


A. Sinan Unur

unread,
Jan 29, 2006, 3:11:22 AM1/29/06
to
"Sisyphus" <sisy...@nomail.afraid.org> wrote in
news:43dc749c$0$15126$afc3...@news.optusnet.com.au:

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

Sisyphus

unread,
Jan 29, 2006, 4:05:06 AM1/29/06
to

"A. Sinan Unur" <1u...@llenroc.ude.invalid>

>
> 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


Ch Lamprecht

unread,
Jan 29, 2006, 4:58:52 AM1/29/06
to

>>Binary build 815 [211909] provided by ActiveState
>>http://www.ActiveState.com
>>ActiveState is a division of Sophos.
>>Built Nov 2 2005 08:44:52

>

> 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/"

A. Sinan Unur

unread,
Jan 29, 2006, 9:43:27 AM1/29/06
to
"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?

Sinan

Abigail

unread,
Jan 29, 2006, 3:49:46 PM1/29/06
to
Sisyphus (sisy...@nomail.afraid.org) wrote on MMMMDXXXIV September
MCMXCIII in <URL:news:43dc749c$0$15126$afc3...@news.optusnet.com.au>:

<>
<> 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 ?


Yes.


Abigail
--
perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'

Abigail

unread,
Jan 29, 2006, 3:53:12 PM1/29/06
to
Dr.Ruud (rvtol...@isolution.nl) wrote on MMMMDXXXIV September MCMXCIII
in <URL:news:drh90...@news.isolution.nl>:
__ Abigail schreef:
__ > Sisyphus:
__
__ >> 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'.


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;

BZ

unread,
Jan 29, 2006, 4:12:56 PM1/29/06
to
Abigail wrote in comp.lang.perl.misc:

> That's a bug, and something I can't reproduce under Linux.
> You ought to file a bugreport.

I can (Debian sid). It seems locale dependent, see
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=350377

--
BZ

Sisyphus

unread,
Jan 29, 2006, 6:07:24 PM1/29/06
to

"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' :-)

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


Dr.Ruud

unread,
Jan 29, 2006, 5:32:38 PM1/29/06
to
Dr.Ruud schreef:

> Abigail schreef:
>> Sisyphus:
>
>>> 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


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

unread,
Jan 29, 2006, 6:51:05 PM1/29/06
to
"Sisyphus" <sisy...@nomail.afraid.org> wrote in
news:43dd4b3b$0$21414$afc3...@news.optusnet.com.au:

>
> "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.

Sisyphus

unread,
Jan 29, 2006, 7:17:14 PM1/29/06
to

"Dr.Ruud" <rvtol...@isolution.nl>

>
>
> 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


Sisyphus

unread,
Jan 29, 2006, 7:22:14 PM1/29/06
to

"A. Sinan Unur" <1u...@llenroc.ude.invalid>

>> 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


A. Sinan Unur

unread,
Jan 29, 2006, 7:38:23 PM1/29/06
to
"Sisyphus" <sisy...@nomail.afraid.org> wrote in
news:43dd5cc4$0$11102$afc3...@news.optusnet.com.au:

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.

Sisyphus

unread,
Jan 29, 2006, 8:07:02 PM1/29/06
to

"A. Sinan Unur" <1u...@llenroc.ude.invalid> wrote in message

>


> 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


Dr.Ruud

unread,
Jan 29, 2006, 8:20:21 PM1/29/06
to
Sisyphus schreef:

> Aaah, so AS build 815 *is* afflicted [...]


> I'll file a bug report now.

OK, thanks.

0 new messages