package PDL::CV; use parent qw{ PDL }; # Tell Perl what your parent class is. sub rp { my ($self, $input) = @_; $self .= $input->reshape($self->dims); return $self } sub new { my $class = shift; return bless { PDL => shift, # See PDL::Objects for details. }, $class } #### my $d = PDL::CV->new(sequence(4,5)); my $t = pdl sequence(100,5,5); $d(0,1:4)->rp($t(0,0,1:4));