in reply to get the "last part" of a Path::Class object
sub Path::Class::Dir::basename { return $self->dir_list(-1); } [download]
Alternatively, this idiom would probably work for most cases:
file($p)->basename; [download]