NAME
    File::Temp::MoreUtils - Provide more routines related to creating
    temporary files/dirs

VERSION
    This document describes version 0.001 of File::Temp::MoreUtils (from
    Perl distribution File-Temp-MoreUtils), released on 2021-07-12.

FUNCTIONS
  tempfile_named
    Usage:

     tempfile_named(%args) -> any

    Try to create a temporary file with certain name (but used .tmp1, .tmp2,
    ... suffix if already exists) .

    Examples:

    *   Attempt to create source.pdf, then if already exists source.1.pdf,
        and so on:

         tempfile_named(name => "source.pdf");

    *   Attempt to create source.pdf in a temporary directory, then if
        already exists source.1, and so on:

         tempfile_named(name => "source", dir => undef);

    *   Attempt to create source.pdf, then if already exists
        source.tmp1.pdf, then source.tmp2.pdf, and so on:

         tempfile_named(name => "source.pdf", suffix_start => "tmp1");

    Unlike File::Temp's "tempfile()" which creates a temporary file with a
    unique random name, this routine tries to create a temporary file with a
    specific name, but adds a counter suffix when the specified name already
    exists. This is often desirable in the case when we want the temporary
    file to have a name similarity with another file.

    And like File::Temp's "tempfile()", will return:

     ($fh, $filename)

    This function is not exported by default, but exportable.

    Arguments ('*' denotes required arguments):

    *   dir => *dirname*

        If specified, will create the temporary file here.

        If specified and set to "undef", will create new temporary directory
        using File::Temp's "tempdir" (with CLEANUP option set to true unless
        DEBUG environment variable is set to true) and use this temporary
        directory for the directory, including for subsequent invocation for
        the same process whenever "dir" is set to "undef" again.

    *   name* => *filename*

    *   suffix_start => *str* (default: 1)

        Will use Perl's post-increment operator ("++") to increment the
        suffix, so this works with number as well as letter combinations,
        e.g. "aa" will be incremented to "ab", "ac" and so on.

    Return value: (any)

ENVIRONMENT
  DEBUG
HOMEPAGE
    Please visit the project's homepage at
    <https://metacpan.org/release/File-Temp-MoreUtils>.

SOURCE
    Source repository is at
    <https://github.com/perlancar/perl-File-Temp-MoreUtils>.

BUGS
    Please report any bugs or feature requests on the bugtracker website
    <https://rt.cpan.org/Public/Dist/Display.html?Name=File-Temp-MoreUtils>

    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.

SEE ALSO
    File::Temp

AUTHOR
    perlancar <perlancar@cpan.org>

COPYRIGHT AND LICENSE
    This software is copyright (c) 2021 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.

