# New Ticket Created by  Jeff Horwitz 
# Please include the string:  [perl #61336]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=61336 >


if split() returns fewer elements than the list assignment expects (a 
valid condition), it crashes when trying to assign from an element that 
doesn't exist.

# WORKS
{
     my $handler = 'Foo::Bar.baz';
     my ($class, $method) = split('.', $handler);
     say "class=$class";
     say "method=$method";
}

# FAILS
{
     my $handler = 'Foo::Bar';
     my ($class, $method) = split('.', $handler);
     say "class=$class";
     say "method=$method";
}

# OUTPUT
class=Foo::Bar
method=baz
ResizablePMCArray: Can't shift from an empty array!
current instr.: 'infix:=' pc 12194 (src/builtins/assign.pir:149)
called from Sub '_block40' pc 361 (EVAL_16:127)
called from Sub '_block11' pc 32 (EVAL_16:18)
called from Sub 'parrot;PCT;HLLCompiler;eval' pc 892 
(src/PCT/HLLCompiler.pir:508)
called from Sub 'parrot;PCT;HLLCompiler;evalfiles' pc 1224 
(src/PCT/HLLCompiler.pir:673)
called from Sub 'parrot;PCT;HLLCompiler;command_line' pc 1400 
(src/PCT/HLLCompiler.pir:761)
called from Sub 'parrot;Perl6;Compiler;main' pc 17717 (perl6.pir:166)

Reply via email to