Mojo::File::Role::Extension - Access Mojo::File filename extensions
$file = Mojo::File->new('/some/path.txt')->with_roles('+Extension');
Add file extension access and modifying behaviour to Mojo::File.
The Mojo::File::Role::Extension role adds the following methods to a Mojo::File once composed.
Readonly access to the file extension of the file or directory.
# ['.tar', '.gz']
Readonly access to the file extension(s) of the file or directory. The parts are returned as a Mojo::Collection of strings.
Readonly access to the short name of the file, i.e. prior to the "extension".
Change the extension of the Mojo::File, retaining the rest of the path and return a new Mojo::File object.
This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself.
Roy Storey - <firstname.lastname@example.org>
To install Mojo::File::Role::Extension, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell
For more information on module installation, please visit the detailed CPAN module installation guide.