A cursory glance at File::Spec::Link says it probably will work. I'll go away now to test it. Thanks. I searched CPAN, but coming up with the right search terms is always key!
(...)
Yes, that looks right. I think my solution is something like this:
Thanks!use File::Spec::Link; my $curlink = shift; my $linkto; while ( ($linkto = readlink($curlink)) and $linkto =~ m:^S/: ) { print "from $curlink "; $curlink = File::Spec::Link->linked($curlink); print "to $curlink\n"; } if (-l $curlink) { # do stuff with readlink($curlink) } else { # do stuff with $curlink (now a file) }
In reply to Re^4: Following symlinks manually
by Tanktalus
in thread Following symlinks manually
by Tanktalus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |