http://www.perlmonks.org?node_id=101710


in reply to Symbolic Links

You want to investigate the readlink function.

 my $dir = readlink( '/some/directory' );

If you have symbolic links pointing to other symbolic links you will have to walk down the chain:

while( -l $dir ) { $dir = readlink $dir }

or more concise:

  1 while( -l $dir and $dir=readlink($dir))

--

g r i n d e r