##
...
buildPath : BEFORE canonpath: /home/ghoshabh/ :
buildPath : After canonpath: /home/ghoshabh :
...
####
sub buildPath
{
my $path = shift;
my $trailing = $path =~ /\/$/ ? '/' : '';
...
return $path . $trailing;
}