Help-Site Computer Manuals
Software
Hardware
Programming
Networking
  Algorithms & Data Structures   Programming Languages   Revision Control
  Protocols
  Cameras   Computers   Displays   Keyboards & Mice   Motherboards   Networking   Printers & Scanners   Storage
  Windows   Linux & Unix   Mac

Alvis::Document::Type
Perl extension for guessing and checking the type of a document.

Alvis::Document::Type - Perl extension for guessing and checking the type of a document.


NAME

Alvis::Document::Type - Perl extension for guessing and checking the type of a document (an extension of MIME types).


SYNOPSIS


 use Alvis::Document::Type;

 # Create a new instance

 my $t=Alvis::Document::Type->new(defaultType=>'text',

                                  defaultSubType=>'html');

 if (!defined($t))

 {

    die('Ugh!');

 }

 my ($doc_type,$doc_sub_type)=$t->guess($doc_text);

 if (!(defined($doc_type) && defined($doc_sub_type)))

 {

    die("Guess what? " . $t->errmsg()); 

 }


DESCRIPTION

Tries to guess the type of a document similarly to MIME types (type and a subtype).

Adds subtypes 'rss' and 'html' to MIME type 'text'.


METHODS

new()

Options:


    defaultType       The default type (text).

    defaultSubType    The default subtype (plain).

guess($text)

Tries to guess the type of $text.

errmsg()

Returns a stack of error messages, if any. Empty string otherwise.


SEE ALSO


AUTHOR

Kimmo Valtonen, <kimmo.valtonen@hiit.fi>


COPYRIGHT AND LICENSE

Copyright (C) 2006 by Kimmo Valtonen

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.4 or, at your option, any later version of Perl 5 you may have available.

Programminig
Wy
Wy
yW
Wy
Programming
Wy
Wy
Wy
Wy