The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.
use Test::More;
use strict;
use warnings;

use autobox::Core;


{
    my @array = qw(1 2 3);

    my @added = @array->map(sub { ++$_ });

    is_deeply \@added, [qw(2 3 4)];

    my $arrayref = @array->map( sub { 'foo' } );

    is ref $arrayref, 'ARRAY', "Returns arrayref in scalar context";
}

done_testing;