O
oldyork90
I have a directory $my_dir. I test this with -d.
$my_dir is user defined.
I want to build the file spec "$my_dir . $my_fn", but $my_dir may be
constructed as either /one/two or /one/two/.
I could test for the trailing path separator and act accordingly, but is
there a better way, a "standard" or best practice way, of doing this?
How do you pros build the absolute paths?
I find that in Windows "/one/two//my_file" will work, but I'd rather not.
Thanks in advance.
$my_dir is user defined.
I want to build the file spec "$my_dir . $my_fn", but $my_dir may be
constructed as either /one/two or /one/two/.
I could test for the trailing path separator and act accordingly, but is
there a better way, a "standard" or best practice way, of doing this?
How do you pros build the absolute paths?
I find that in Windows "/one/two//my_file" will work, but I'd rather not.
Thanks in advance.