The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.


File::Symlink::Relative - Create relative symbolic links


 use File::Symlink::Relative;

 symlink_r $source, $target;


This Perl package creates relative symbolic links. All it really does is wrap the symlink built-in in suitable code.


This class supports the following public subroutine:

This subroutine creates a relative symbolic link. All it really does is to wrap the Perl symlink built-in with code to convert the source file specification (OLDFILE in the parlance of perldoc -f symlink) to a path relative to the target file (NEWFILE, a.k.a. the link to be created), and then delegate to the symlink built-in.

It returns whatever the built-in returns. An exception will be thrown if the operating system does not support symbolic links. See PORTABILITY below.

This subroutine is exported by default.


The functionality in this module requires the Perl symlink() built-in to work under the host operating system. Without this support, the module should still install and load, but will throw an exception when called.

This manifest constant is true if symbolic links are supported, and false if not.

It is not exported by default, but can be imported to your module by name or using the :all tag.



The documentation for the symlink built-in.


This module was inspired by /r/perl post


Support is by the author. Please file bug reports at,, or in electronic mail to the author.


Thomas R. Wyant, III wyant at cpan dot org


Copyright (C) 2020-2021 by Thomas R. Wyant, III

This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5.10.0. For more details, see the full text of the licenses in the directory LICENSES.

This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.