# New Ticket Created by Steve Schulze # Please include the string: [perl #126049] # in the subject line of all future correspondence about this issue. # <URL: https://rt.perl.org/Ticket/Display.html?id=126049 >
Post GLR, implicitly returning nothing from a subroutine now returns an empty container. Becomes a problem when assigning to an array as it now ends up containing an element even if none was returned. perl6 -e' sub h () { return }; my @p = h(); say @p, so @p ' [(Any)]True perl6 -e' sub h () { }; my @p = h(); say @p, so @p ' [(Any)]True Now if you want to return nothing, you need to do it explicitly. perl6 -e' sub h () { return () }; my @p = h(); say @p, so @p ' []False perl6 -e' sub h () { () }; my @p = h(); say @p, so @p ' []False Could be argued that it isn't a bug, but it is surprising to me and is different from pre GLR behaviour.