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

NAME

Filename::Compressed - Check whether filename indicates being compressed

VERSION

This document describes version 0.03 of Filename::Compressed (from Perl distribution Filename-Compressed), released on 2015-01-01.

SYNOPSIS

use Filename::Compressed qw(check_compressed_filename);
my $res = check_compressed_filename(filename => "foo.txt.gz");
if ($res) {
    printf "File is compressed with %s, uncompressed name: %s\n",
        $res->{compressor_name},
        $res->{uncompressed_filename};
} else {
    print "File is not compressed\n";
}

DESCRIPTION

FUNCTIONS

check_compressed_filename(%args) -> bool|hash

Check whether filename indicates being compressed.

Arguments ('*' denotes required arguments):

  • ci => bool (default: 1)

    Whether to match case-insensitively.

  • filename* => str

Return value:

(any)

Return false if no compressor suffixes detected. Otherwise return a hash of information, which contains these keys: compressor_name, compressor_suffix, uncompressed_filename.

TODO

SEE ALSO

Filename::Archive

HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/Filename-Compressed.

SOURCE

Source repository is at https://github.com/perlancar/perl-Filename-Compressed.

BUGS

Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Filename-Compressed

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

AUTHOR

perlancar <perlancar@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by perlancar@cpan.org.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.