Open p5pRT opened 6 years ago
perl -wlE '$_="-4-5"; say -$_|0' Argument "+4-5" isn't numeric in bitwise or (|) at -e line 1. 4
perl -wlE '$_=-4 . -5; say -$_|0' Argument "+4-5" isn't numeric in bitwise or (|) at -e line 1. 4
perl -wlE '$_="-4-5"; $_+0; say -$_|0' Useless use of addition (+) in void context at -e line 1. Argument "-4-5" isn't numeric in addition (+) at -e line 1. Argument "+4-5" isn't numeric in bitwise or (|) at -e line 1. 4
erl -wlE '$_=-4 . -5; $_+0; say -$_|0' Useless use of addition (+) in void context at -e line 1. Argument "-4-5" isn't numeric in addition (+) at -e line 1. 18446744073709551612
That last one is very unexpected. The same thing happens on perl 5.26.1
On Sun\, 25 Feb 2018 18:25:19 GMT\, perl@ton.iguana.be wrote:
This is a bug report for perl from perl@ton.iguana.be\, generated with the help of perlbug 1.40 running under perl 5.20.2.
----------------------------------------------------------------- [Please describe your issue here]
perl -wlE '$_="-4-5"; say -$_|0' Argument "+4-5" isn't numeric in bitwise or (|) at -e line 1. 4
perl -wlE '$_=-4 . -5; say -$_|0' Argument "+4-5" isn't numeric in bitwise or (|) at -e line 1. 4
perl -wlE '$_="-4-5"; $_+0; say -$_|0' Useless use of addition (+) in void context at -e line 1. Argument "-4-5" isn't numeric in addition (+) at -e line 1. Argument "+4-5" isn't numeric in bitwise or (|) at -e line 1. 4
perl -wlE '$_=-4 . -5; $_+0; say -$_|0' Useless use of addition (+) in void context at -e line 1. Argument "-4-5" isn't numeric in addition (+) at -e line 1. 18446744073709551612
That last one is very unexpected. The same thing happens on perl 5.26.1
I do not get the same results as you.
##### $ perl -v | head -2 | tail -1 This is perl 5\, version 20\, subversion 3 (v5.20.3) built for x86_64-linux
$ perl -wlE '$_="-4 . -5"; $_+0; say -$_|0' Useless use of addition (+) in void context at -e line 1. Argument "-4 . -5" isn't numeric in addition (+) at -e line 1. Argument "+4 . -5" isn't numeric in bitwise or (|) at -e line 1. 4
$ perl -v | head -2 | tail -1 This is perl 5\, version 26\, subversion 0 (v5.26.0) built for x86_64-linux
$ perl -wlE '$_="-4 . -5"; $_+0; say -$_|0' Useless use of addition (+) in void context at -e line 1. Argument "-4 . -5" isn't numeric in addition (+) at -e line 1. Argument "+4 . -5" isn't numeric in bitwise or (|) at -e line 1. 4 #####
Thank you very much. -- James E Keenan (jkeenan@cpan.org)
The RT System itself - Status changed from 'new' to 'open'
On Sun\, Feb 25\, 2018 at 02:10:41PM -0800\, James E Keenan via RT wrote:
perl -wlE '$_="-4-5"; $_+0; say -$_|0' Useless use of addition (+) in void context at -e line 1. Argument "-4-5" isn't numeric in addition (+) at -e line 1. Argument "+4-5" isn't numeric in bitwise or (|) at -e line 1. 4
perl -wlE '$_=-4 . -5; $_+0; say -$_|0' Useless use of addition (+) in void context at -e line 1. Argument "-4-5" isn't numeric in addition (+) at -e line 1. 18446744073709551612
In the first example\, $_="-4-5"\, $_ uses COW to share the string buffer of the constant string; in $_=-4 . -5\, the expression stops $_ being COW (even though the expression is constant folded).
When the string is used in numeric context\, its pIOK and pNOK flags get set.
However\, the result of the expression -$_ only has its pIOK and pNOK flags set in the non-COW case.
I haven't looked any further yet at why that is.
-- Red sky at night - gerroff my land! Red sky at morning - gerroff my land! -- old farmers' sayings #14
On Sun\, Feb 25\, 2018 at 02:10:41PM -0800\, James E Keenan via RT wrote:
On Sun\, 25 Feb 2018 18:25:19 GMT\, perl@ton.iguana.be wrote:
This is a bug report for perl from perl@ton.iguana.be\, generated with the help of perlbug 1.40 running under perl 5.20.2.
----------------------------------------------------------------- [Please describe your issue here]
perl -wlE '$_="-4-5"; say -$_|0' Argument "+4-5" isn't numeric in bitwise or (|) at -e line 1. 4
perl -wlE '$_=-4 . -5; say -$_|0' Argument "+4-5" isn't numeric in bitwise or (|) at -e line 1. 4
perl -wlE '$_="-4-5"; $_+0; say -$_|0' Useless use of addition (+) in void context at -e line 1. Argument "-4-5" isn't numeric in addition (+) at -e line 1. Argument "+4-5" isn't numeric in bitwise or (|) at -e line 1. 4
perl -wlE '$_=-4 . -5; $_+0; say -$_|0' Useless use of addition (+) in void context at -e line 1. Argument "-4-5" isn't numeric in addition (+) at -e line 1. 18446744073709551612
That last one is very unexpected. The same thing happens on perl 5.26.1
I do not get the same results as you.
Is that because you're using different code\, or because of something else?
##### $ perl -v | head -2 | tail -1 This is perl 5\, version 20\, subversion 3 (v5.20.3) built for x86_64-linux
$ perl -wlE '$_="-4 . -5"; $_+0; say -$_|0'
That's not the same as written in the bug report:
perl -wlE '$_=-4 . -5; $_+0; say -$_|0'
Note the absense of quotes around C\<\< -4 . -5 >> in the report\, while your code puts quotes there.
Useless use of addition (+) in void context at -e line 1. Argument "-4 . -5" isn't numeric in addition (+) at -e line 1. Argument "+4 . -5" isn't numeric in bitwise or (|) at -e line 1. 4
$ perl -v | head -2 | tail -1 This is perl 5\, version 26\, subversion 0 (v5.26.0) built for x86_64-linux
$ perl -wlE '$_="-4 . -5"; $_+0; say -$_|0' Useless use of addition (+) in void context at -e line 1. Argument "-4 . -5" isn't numeric in addition (+) at -e line 1. Argument "+4 . -5" isn't numeric in bitwise or (|) at -e line 1. 4
Abigail
On Mon\, 26 Feb 2018 11:39:05 GMT\, abigail@abigail.be wrote:
On Sun\, Feb 25\, 2018 at 02:10:41PM -0800\, James E Keenan via RT wrote:
On Sun\, 25 Feb 2018 18:25:19 GMT\, perl@ton.iguana.be wrote:
This is a bug report for perl from perl@ton.iguana.be\, generated with the help of perlbug 1.40 running under perl 5.20.2.
----------------------------------------------------------------- [Please describe your issue here]
perl -wlE '$_="-4-5"; say -$_|0' Argument "+4-5" isn't numeric in bitwise or (|) at -e line 1. 4
perl -wlE '$_=-4 . -5; say -$_|0' Argument "+4-5" isn't numeric in bitwise or (|) at -e line 1. 4
perl -wlE '$_="-4-5"; $_+0; say -$_|0' Useless use of addition (+) in void context at -e line 1. Argument "-4-5" isn't numeric in addition (+) at -e line 1. Argument "+4-5" isn't numeric in bitwise or (|) at -e line 1. 4
perl -wlE '$_=-4 . -5; $_+0; say -$_|0' Useless use of addition (+) in void context at -e line 1. Argument "-4-5" isn't numeric in addition (+) at -e line 1. 18446744073709551612
That last one is very unexpected. The same thing happens on perl 5.26.1
I do not get the same results as you.
Is that because you're using different code\, or because of something else?
##### $ perl -v | head -2 | tail -1 This is perl 5\, version 20\, subversion 3 (v5.20.3) built for x86_64-linux
$ perl -wlE '$_="-4 . -5"; $_+0; say -$_|0'
That's not the same as written in the bug report:
perl -wlE '$_=-4 . -5; $_+0; say -$_|0'
Note the absense of quotes around C\<\< -4 . -5 >> in the report\, while your code puts quotes there.
You are correct. Please ignore my previous post.
Useless use of addition (+) in void context at -e line 1. Argument "-4 . -5" isn't numeric in addition (+) at -e line 1. Argument "+4 . -5" isn't numeric in bitwise or (|) at -e line 1. 4
$ perl -v | head -2 | tail -1 This is perl 5\, version 26\, subversion 0 (v5.26.0) built for x86_64-linux
$ perl -wlE '$_="-4 . -5"; $_+0; say -$_|0' Useless use of addition (+) in void context at -e line 1. Argument "-4 . -5" isn't numeric in addition (+) at -e line 1. Argument "+4 . -5" isn't numeric in bitwise or (|) at -e line 1. 4
Abigail
Thank you very much. -- James E Keenan (jkeenan@cpan.org)
On Sun\, 25 Feb 2018 10:25:19 -0800\, "perl@ton.iguana.be (via RT)" \perlbug\-followup@​perl\.org wrote:
perl -wlE '$_="-4-5"; say -$_|0' Argument "+4-5" isn't numeric in bitwise or (|) at -e line 1. 4
perl -wlE '$_=-4 . -5; say -$_|0' Argument "+4-5" isn't numeric in bitwise or (|) at -e line 1. 4
perl -wlE '$_="-4-5"; $_+0; say -$_|0' Useless use of addition (+) in void context at -e line 1. Argument "-4-5" isn't numeric in addition (+) at -e line 1. Argument "+4-5" isn't numeric in bitwise or (|) at -e line 1. 4
perl -wlE '$_=-4 . -5; $_+0; say -$_|0' Useless use of addition (+) in void context at -e line 1. Argument "-4-5" isn't numeric in addition (+) at -e line 1. 18446744073709551612
That last one is very unexpected. The same thing happens on perl 5.26.1
Step-by-step on the last one ...
$ perl -MDP -wE'$_ = -4 . -5;DDump$_;$_+0;DDump$_;say $_|0;DDump$_' Useless use of addition (+) in void context at -e line 1. SV = PV(0x24679f0) at 0x24b0ab0 REFCNT = 1 FLAGS = (POK\,pPOK) PV = 0x24839f0 "-4-5"\0 CUR = 4 LEN = 10 Argument "-4-5" isn't numeric in addition (+) at -e line 1. SV = PVNV(0x370b100) at 0x24b0ab0 REFCNT = 1 FLAGS = (POK\,pIOK\,pNOK\,pPOK) IV = -4 NV = -4 PV = 0x24839f0 "-4-5"\0 CUR = 4 LEN = 10 18446744073709551612 SV = PVNV(0x370b100) at 0x24b0ab0 REFCNT = 1 FLAGS = (POK\,pIOK\,pNOK\,pPOK) IV = -4 NV = -4 PV = 0x24839f0 "-4-5"\0 CUR = 4 LEN = 10
-- H.Merijn Brand http://tux.nl Perl Monger http://amsterdam.pm.org/ using perl5.00307 .. 5.27 porting perl5 on HP-UX\, AIX\, and openSUSE http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/ http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/
Migrated from rt.perl.org#132908 (status was 'open')
Searchable as RT132908$