Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
23 lines (14 sloc) 552 Bytes
use Test::More qw(no_plan);
use strict;
use warnings;
use autobox::Core;
my $scalar = 'foo';
my($reverse) = $scalar->reverse; # list context
is $reverse, 'oof', 'reverse in list context reverses the scalar';
is scalar $scalar->reverse, 'oof', 'reverse in scalar context reverses the scalar';
is "Hello"->reverse, "olleH";
my @list = qw(foo bar baz);
is_deeply [@list->reverse], [qw(baz bar foo)];
my $arrayref = @list->reverse;
is ref $arrayref, "ARRAY", "returns an arrayref in scalar context";
Jump to Line
Something went wrong with that request. Please try again.