New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
String/Number interpretation of a string #16439
Comments
From perl@ton.iguana.beCreated by perl@ton.iguana.beperl -wlE '$_="-4-5"; say -$_|0' perl -wlE '$_=-4 . -5; say -$_|0' perl -wlE '$_="-4-5"; $_+0; say -$_|0' erl -wlE '$_=-4 . -5; $_+0; say -$_|0' That last one is very unexpected. Perl Info
|
From @jkeenanOn Sun, 25 Feb 2018 18:25:19 GMT, perl@ton.iguana.be wrote:
I do not get the same results as you. ##### $ perl -wlE '$_="-4 . -5"; $_+0; say -$_|0' $ perl -v | head -2 | tail -1 $ perl -wlE '$_="-4 . -5"; $_+0; say -$_|0' Thank you very much. |
The RT System itself - Status changed from 'new' to 'open' |
From @iabynOn Sun, Feb 25, 2018 at 02:10:41PM -0800, James E Keenan via RT wrote:
In the first example, $_="-4-5", $_ uses COW to share the string buffer When the string is used in numeric context, its pIOK and pNOK However, the result of the expression -$_ only has its pIOK and pNOK flags I haven't looked any further yet at why that is. -- |
From @AbigailOn Sun, Feb 25, 2018 at 02:10:41PM -0800, James E Keenan via RT wrote:
Is that because you're using different code, or because of something else?
That's not the same as written in the bug report:
Note the absense of quotes around C<< -4 . -5 >> in the report,
Abigail |
From @jkeenanOn Mon, 26 Feb 2018 11:39:05 GMT, abigail@abigail.be wrote:
You are correct. Please ignore my previous post.
Thank you very much. |
From @TuxOn Sun, 25 Feb 2018 10:25:19 -0800, "perl@ton.iguana.be (via RT)"
Step-by-step on the last one ... $ perl -MDP -wE'$_ = -4 . -5;DDump$_;$_+0;DDump$_;say $_|0;DDump$_' -- |
Migrated from rt.perl.org#132908 (status was 'open')
Searchable as RT132908$
The text was updated successfully, but these errors were encountered: