Mar 23, 2016, 3:13 AM
Post #1 of 3
I created a link 'date_link.txt' which is a link to 'date.txt' file. I'm trying to get the full path for 'date_link.txt'. When I try the following code,
Cwd::abs_path V/S File::Spec->rel2abs
$f = 'date_link.txt';
say 'abs_path(): ' . Cwd::abs_path ($f);
say 'rel2abs(): ' . File::Spec->rel2abs ($f);
rel2abs gives the required output. I was expecting both rel2abs & abs_path to return the same value. But abs_path returns the path of the real file. Isn't it the way it works?