open my $fh, '/etc/motd'; my $fd = fileno($fh); print readlink("/proc/$$/fd/$fd");