use PSI::ESP qw( DWIM ); ## . . . my $full_path = DWIM( "add a full path before a file name", $short_path );