develooper Front page | perl.perl5.porters | Postings from February 2019

[perl #133822] split pattern allows barewords under use strict'subs'

Thread Previous
From:
Dan Book
Date:
February 4, 2019 23:09
Subject:
[perl #133822] split pattern allows barewords under use strict'subs'
Message ID:
rt-4.0.24-12913-1549321770-1378.133822-75-0@perl.org
# New Ticket Created by  Dan Book 
# Please include the string:  [perl #133822]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=133822 >


The first argument to split appears to allow a bareword and interprets it
as a string with no error, even with strict 'subs' active. This is at the
very least undocumented.

perl -E'use strict; say for split foo, "barfoobar"'

The unary + does not even affect the behavior.

perl -E'use strict; say for split +foo, "barfoobar"'

-Dan

(Perl)


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