---
name: "Debian::PkgPerl::Util"
section: "3pm"
platform: "linux"
package: "pkg-perl-tools"
version: "0.82"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Debian::PkgPerl::Util"
---

# Debian::PkgPerl::Util(3pm)

utility functions for PkgPerl tools

## NAME

Debian::PkgPerl::Util - utility functions for PkgPerl tools

## SYNOPSIS

```
 use Debian::PkgPerl::Util;
 ...
 $dep = "$dep <!nocheck>"
     unless Debian::PkgPerl::Util->probable_build_dependency($pkg);
 $cachefile = Debian::PkgPerl::Util->download_and_cache_file(
     "https://example.com/foo.txt",
     "bla.txt",
     86400
 );
```

## DESCRIPTION

**Debian::PkgPerl::Util** contains some utility functions for PkgPerl tools.

## METHODS

- **probable\_build\_dependency**(*package name*)

  Returns true if the package name is likely to be used for building, and not only at runtime or only for testing.

- **download\_and\_cache\_file**(*URL*, *local filename*, *expiration time in seconds*)

  Helper function to download a file from *URL* and save it in *$ENV{XDG\_CACHE\_HOME}/pkg-perl-tools/* (or *$ENV{HOME}/.cache/pkg-perl-tools/*) as *filename*, unless the file already exists and is younger than *expiration time* in seconds.

  Returns the full filename as a string.

## COPYRIGHT AND LICENSE

- Copyright 2022-2023 gregor herrmann gregoa@debian.org

  - Copyright 2022 Damyan Ivanov dmn@debian.org

  This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See \<http://dev.perl.org/licenses/\> for more information.
