my $path = defined($dir) ? $dir : '' . defined($sub_dir) ? $sub_dir : '' . defined($file) ? $file : '';