You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
Migrated from rt.perl.org#61336 (status was 'resolved')
Searchable as RT61336$
The text was updated successfully, but these errors were encountered: