in reply to How to test if a file is gzipped or not

IO::Uncompress::AnyInflate will gunzip data, and has a Transparent option. The option is useful as you can select if you want non-gzipped data to just pass through and be returned as if it was the uncompressed result, or if you want it to throw an error.

  • Comment on Re: How to test if a file is gzipped or not

Replies are listed 'Best First'.
Re^2: How to test if a file is gzipped or not
by soonix (Chancellor) on Jun 18, 2024 at 07:35 UTC

    TIL IO::Uncompress::AnyInflate exists.

    I don't know if it's important for Special_K, but I read under "Transparent":
    In addition, if the input file/buffer does contain compressed data and there is non-compressed data immediately following it, setting this option will make this module treat the whole file/buffer as a single data stream.
    This might pose a security risk, if one isn't aware of it.