develooper Front page | perl.perl5.porters | Postings from July 2016

[perl #36333] sort CONSTANT exhibits weird behavior

Thread Previous
From:
Dan Collins via RT
Date:
July 8, 2016 00:58
Subject:
[perl #36333] sort CONSTANT exhibits weird behavior
Message ID:
rt-4.0.18-29256-1467939498-385.36333-15-0@perl.org
dcollins@nightshade64:~/toolchain$ perl5.25.2 -MO=Deparse -le 'use constant NUMBERS => qw(one two three); print sort NUMBERS;'
BEGIN { $/ = "\n"; $\ = "\n"; }
use constant ('NUMBERS', ('one', 'two', 'three'));
print sort('NUMBERS');
-e syntax OK
dcollins@nightshade64:~/toolchain$ perl5.25.2 -MO=Deparse -le 'use constant NUMBERS => qw(one two three); print sort NUMBERS();'
BEGIN { $/ = "\n"; $\ = "\n"; }
use constant ('NUMBERS', ('one', 'two', 'three'));
print((sort NUMBERS ()));
-e syntax OK
dcollins@nightshade64:~/toolchain$ perl5.25.2 -MO=Deparse -le 'use constant NUMBERS => qw(one two three); print sort (NUMBERS);'
BEGIN { $/ = "\n"; $\ = "\n"; }
use constant ('NUMBERS', ('one', 'two', 'three'));
print sort('NUMBERS');
-e syntax OK
dcollins@nightshade64:~/toolchain$ perl5.25.2 -MO=Deparse -le 'use constant NUMBERS => qw(one two three); print sort (NUMBERS());'
BEGIN { $/ = "\n"; $\ = "\n"; }
use constant ('NUMBERS', ('one', 'two', 'three'));
print sort(('one', 'two', 'three'));
-e syntax OK

It's being interpreted as a bareword for some reason?

---
via perlbug:  queue: perl5 status: new
https://rt.perl.org/Ticket/Display.html?id=36333

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About