# https://metacpan.org/release/KWILLIAMS/Path-Class-0.37/source/lib/Path/Class/Entity.pm#L65 sub resolve { my $self = shift; Carp::croak($! . " $self") unless -e $self; # No such file or directory my $cleaned = $self->new( scalar Cwd::realpath($self->stringify) ); # realpath() always returns absolute path, kind of annoying $cleaned = $cleaned->relative if $self->is_relative; # line 71 (76 in your modified version) %$self = %$cleaned; return $self; }