--- name: readlink status: documented runtime: pp source: src/runtime/pp/filemod.rs --- ```{index} single: readlink; Perl built-in (pp runtime) ``` # readlink ## Synopsis ```perl my $target = readlink $symlink; my $target = readlink '/usr/bin/perl'; my $target = readlink; # readlink($_) ``` ## Description Returns the target of a symbolic link. Returns the filename pointed to by the symbolic link EXPR, or `$_` if omitted. Returns `undef` on error (e.g., not a symlink, file not found) and sets `$!`. Uses `std::fs::read_link` and converts the result to a string via `to_string_lossy`. ## See also symlink, lstat, stat