Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pod/perldelta.pod
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,11 @@ consisted of only ASCII characters. The real upper limit was as few as
Chinese or Osage. Now an identifier in any language may contain at
least 255 characters.

=item *

Fixed parsing of array names starting with a digit in double-quotish
context under C<use utf8;>.

=back

=head1 Known Problems
Expand Down
10 changes: 9 additions & 1 deletion t/op/sub_lval.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ BEGIN {
require './test.pl';
set_up_inc('../lib');
}
plan tests=>213;
plan tests=>215;

sub a : lvalue { my $a = 34; ${\(bless \$a)} } # Return a temporary
sub b : lvalue { ${\shift} }
Expand Down Expand Up @@ -1041,6 +1041,14 @@ sub else119797 : lvalue {
eval { (else119797(0)) = 1..3 };
is $@, "", '$@ after writing to array returned by else';
is "@119797", "1 2 3", 'writing to array returned by else';

{ # Being in UTF-8 used to break this
use utf8;
eval { (else119797(0)) = 1..3 };
is $@, "", '$@ after writing to array returned by else';
is "@119797", "1 2 3", 'writing to array returned by else';
}

eval { (else119797(1)) = 4..6 };
is $@, "", '$@ after writing to array returned by if (with else)';
is "@119797", "4 5 6", 'writing to array returned by if (with else)';
Expand Down
5 changes: 1 addition & 4 deletions toke.c
Original file line number Diff line number Diff line change
Expand Up @@ -3697,10 +3697,7 @@ S_scan_const(pTHX_ char *start)
* (@foo, @::foo, @'foo, @{foo}, @$foo, @+, @-)
*/
else if (*s == '@' && s[1]) {
if (UTF
? isIDFIRST_utf8_safe(s+1, send)
: isWORDCHAR_A(s[1]))
{
if (isDIGIT_A(s[1]) || isIDFIRST_lazy_if_safe(s+1, send, UTF)) {
break;
}
if (memCHRs(":'{$", s[1]))
Expand Down
Loading