$ cd /var/tmp $ mkdir mydir $ mkdir datadir $ mkdir otherdir $ touch mydir/in_mydir $ touch datadir/in_datadir $ touch otherdir/in_otherdir $ cd otherdir $ ln -s ../mydir symdir $ ls /var/tmp/otherdir/symdir/../datadir in_datadir $ perl -le'opendir $dh, $ARGV[0] or die; print for grep /in/, readdir $dh' /var/tmp/otherdir/symdir/../datadir in_datadir