Copyright (C) 2000-2012 |
Manpages MIME::Field::ContTypeSection: User Contributed Perl Documentation (3)Updated: perl v5.6.1 Index Return to Main Contents NAMEMIME::Field::ContType - a ``Content-type'' fieldDESCRIPTIONA subclass of Mail::Field.Don't use this class directly... its name may change in the future! Instead, ask Mail::Field for new instances based on the field name! SYNOPSISuse Mail::Field; use MIME::Head; # Create an instance from some text: $field = Mail::Field->new('Content-type', 'text/HTML; charset="US-ASCII"'); # Get the MIME type, like 'text/plain' or 'x-foobar'. # Returns 'text/plain' as default, as per RFC-1521: my ($type, $subtype) = split('/', $field->type); # Get generic information: print $field->name; # Get information related to "message" type: if ($type eq 'message') { print $field->id; print $field->number; print $field->total; } # Get information related to "multipart" type: if ($type eq 'multipart') { print $field->boundary; # the basic value, fixed up print $field->multipart_boundary; # empty if not a multipart message! } # Get information related to "text" type: if ($type eq 'text') { print $field->charset; # returns 'us-ascii' as default } PUBLIC INTERFACE
NOTESSince nearly all (if not all) parameters must have non-empty values to be considered valid, we just return the empty string to signify missing fields. If you need to get the real underlying value, use the inherited "param()" method (which returns undef if the parameter is missing).AUTHOREryq (eryq@zeegee.com), ZeeGee Software Inc (http://www.zeegee.com).
IndexThis document was created by man2html, using the manual pages. Time: 19:46:43 GMT, April 19, 2024 |