in reply to Cleaning up a path

While a little out of the target of my OP, I've found that Cwd actually has something that really cleans up a path dealing with all the symlink issues:
#!/usr/bin/perl use strict; use warnings; use Cwd 'abs_path'; my $somepath = "/var/log/../../home/poletti/../../etc/passwd"; print "starting path: [$somepath]\n"; print "abs_path : [", abs_path($somepath), "]\n" __END__ starting path: [/var/log/../../home/poletti/../../etc/passwd] abs_path : [/etc/passwd]
According to the docs:
abs_path my $abs_path = abs_path($file); Uses the same algorithm as getcwd(). Symbolic links and re +lative- path components ("." and "..") are resolved to return the c +anonical pathname, just like realpath(3).
This probably requires that the file actually lives in the filesystem, but most of the time it's what one wants. Thank you all for the contributions, anyway :)

Flavio
perl -ple'$_=reverse' <<<ti.xittelop@oivalf

Don't fool yourself.