use warnings; use strict; use Path::Tiny; my $path = path("/a/b/c/$ENV{USER}")->absolute; print "$path\n"; #### spek@scelia ~/scratch $ perl path.pl /a/b/c/spek