MIME::ToolUtils

Home | MIME::Body | MIME::Decoder | MIME::Entity | MIME::Head
MIME::IO | MIME::Latin1 | MIME::Parser | MIME::ParserBase
MIME::ToolUtils

# MIME:: ToolUtils It's MIME time! | NAME DESCRIPTION PUBLIC INTERFACE AUTHOR VERSION

## NAME

MIME::ToolUtils - MIME-tools kit configuration and utilities

## DESCRIPTION

A catch-all place for miscellaneous global information related to the configuration of the MIME-tools kit.

## PUBLIC INTERFACE

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.

## AUTHOR

Copyright (c) 1996 by Eryq / eryq@rhine.gsfc.nasa.gov

All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

## VERSION

$Revision: 2.13 $ $Date: 1997/01/13 01:37:53 $

Note: this file is used to set the version of the entire MIME-tools distribution.