- debugging [ONOFF]
-
Class method.
Turn debugging on (if ONOFF is true) or off (if ONOFF is false) for the
entire MIME-tools library. Debug messages go to STDERR.
With no argument, this method just returns the current setting.
- emulate_tmpfile [OPTION]
-
Class method.
Determines how to patch a Perl 5.002 bug in FileHandle::new_tmpfile, and
get a FileHandle object which really will
be destroyed when it goes out of scope. Possible options are:
- OPENDUP
-
Always emulate FileHandle->new_tmpfile, using an fd-opened duplicate
filehandle. Pretty ugly (two additional filehandles sharing the same
descriptor are briefly open at one point, though both are closed before the
new tmpfile object is returned): however, it's probably quite portable
since it (a) doesn't require POSIX, and (b) doesn't make assumptions as to
the underlying implementation of FileHandle objects.
- UNLINK
-
Always emulate FileHandle->new_tmpfile, using
tmpnam()
plus
unlink().
Probably only works on Unix-like systems, but is
very straightforward. Depends on POSIX::tmpnam() and on the
autodelete-on-unlink behavior.
- NO
-
No emulation: always just use FileHandle->new_tmpfile to get tmpfile
handles.
- (a subroutine reference)
-
Use this subroutine.
If any of the emulation options ends with '!' (e.g., ``UNLINK!''), then the
package will always
emulate that way. Otherwise, it will try to make a reasonable guess as to
whether emulation is necessary, based on your version of Perl.
The default setting (if you never invoke this method) is OPENDUP.
With no argument, this method just returns the current setting.
- emulate_version [VERSION]
-
Class method.
Emulate the behavior of a previous version of the MIME-tools kit (a.k.a the
MIME-parser kit in its version 1.x incarnations). This will not
turn off warnings about deprecated usage (that would impede progress), but
it will
patch things like the
get()
method of MIME::Head:
MIME::ToolUtils->emulate_version(1.0)
The VERSION should be '1' or '1.0'.
With no argument, this method just returns the current setting.
All rights reserved. This program is free software; you can redistribute it
and/or modify it under the same terms as Perl itself.