1Mail::SpamAssassin::UtiUls(e3r)Contributed Perl DocumentMaatiilo:n:SpamAssassin::Util(3)
2
3
4

NAME

6       Mail::SpamAssassin::Util - utility functions
7

DESCRIPTION

9       A general class for utility functions.  Please use this for functions
10       that stand alone, without requiring a $self object, Portability
11       functions especially.
12
13       NOTE: The functions in this module are to be considered private.  Their
14       API may change at any point, and it's expected that they'll only be
15       used by other Mail::SpamAssassin modules. (TODO: we should probably
16       revisit this if it's useful for plugin development.)
17
18       NOTE: Utility functions should not be changing global variables such as
19       $_, $1, $2, ... $/, etc. unless explicitly documented.  If these
20       variables are in use by these functions, they should be localized.
21
22       $module = first_available_module (@module_list)
23           Return the name of the first module that can be successfully loaded
24           with "require" from the list.  Returns "undef" if none are
25           available.
26
27           This is used instead of "AnyDBM_File" as follows:
28
29             my $module = Mail::SpamAssassin::Util::first_available_module
30                                   (qw(DB_File GDBM_File NDBM_File SDBM_File));
31             tie %hash, $module, $path, [... args];
32
33           Note that "SDBM_File" is guaranteed to be present, since it comes
34           with Perl.
35
36       my ($filepath, $filehandle) = secure_tmpfile();
37           Generates a filename for a temporary file, opens it exclusively and
38           securely, and returns a filehandle to the open file (opened
39           O_RDWR).
40
41           If it cannot open a file after 20 tries, it returns "undef".
42
43       my ($dirpath) = secure_tmpdir();
44           Generates a directory for temporary files.  Creates it securely and
45           returns the path to the directory.
46
47           If it cannot create a directory after 20 tries, it returns "undef".
48
49
50
51perl v5.16.3                      2014-02-07       Mail::SpamAssassin::Util(3)
Impressum