use v5.14; package Foo { sub new { my $class = shift; say "new"; bless [] => $class; } sub some_method { my $self = shift; say "some_method"; return $self; } sub other_method { my $self = shift; say "other_method"; return 123; } sub DESTROY { my $self = shift; say "DESTROY"; } } say "START"; say Foo->new->some_method->other_method and say 456; say "END";