From 63abdbc100c78e7650014edf2a47741d49f9dff7 Mon Sep 17 00:00:00 2001 From: Tim Gim Yee Date: Wed, 24 Oct 2018 22:58:20 -0700 Subject: [PATCH] Document exportable functions, constants and :tags --- lib/File/Temp.pm | 50 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/lib/File/Temp.pm b/lib/File/Temp.pm index 8cfb99b..6f130ee 100644 --- a/lib/File/Temp.pm +++ b/lib/File/Temp.pm @@ -2318,6 +2318,56 @@ Current API available since 0.15. =back +=head1 EXPORTS + +These functions are not exported by default but may be exported +individually: + + tempfile + tempdir + unlink0 + cleanup + +The functions and constants in these export tags are exported by +default: + +=over + +=item :POSIX + +Exports the L: + + tmpnam + tmpfile + +=item :mktemp + +Exports the L: + + mktemp + mkstemp + mkstemps + mkdtemp + +=item :seekable + +Exports the seek constants: + + SEEK_SET + SEEK_CUR + SEEK_END + +=back + +So these two are equivalent: + + use File::Temp; + use File::Temp qw/ :POSIX :mktemp :seekable /; + +Use an empty list to export nothing: + + use File::Temp (); + =head1 PACKAGE VARIABLES These functions control the global state of the package.