1Mail::Message::Field::FUassetr(3C)ontributed Perl DocumeMnatialt:i:oMnessage::Field::Fast(3)
2
3
4

NAME

6       Mail::Message::Field::Fast - one line of a message header
7

INHERITANCE

9        Mail::Message::Field::Fast
10          is a Mail::Message::Field
11          is a Mail::Reporter
12

SYNOPSIS

14        See Mail::Message::Field
15

DESCRIPTION

17       This is the faster, but less flexible implementation of a header field.
18       The data is stored in an array, and some hacks are made to speeds
19       things up.  Be gentle with me, and consider that each message contains
20       many of these lines, so speed is very important here.
21

OVERLOADED

23       overload: ""
24           See "OVERLOADED" in Mail::Message::Field
25
26       overload: +0
27           See "OVERLOADED" in Mail::Message::Field
28
29       overload: <=>
30           See "OVERLOADED" in Mail::Message::Field
31
32       overload: bool
33           See "OVERLOADED" in Mail::Message::Field
34
35       overload: cmp
36           See "OVERLOADED" in Mail::Message::Field
37

METHODS

39   Constructors
40       $obj->clone
41           See "Constructors" in Mail::Message::Field
42
43       Mail::Message::Field::Fast->new(DATA)
44           The constructor of this object does not follow the usual practise
45           within the Mail::Box suite: it does not use the constructor
46           Mail::Reporter::new().  Therefor it has no logging or tracing
47           facilities.
48
49           The method can be used in one of the following ways:
50
51           ·   new LINE
52
53               Pass a LINE as it could be found in a file: a (possibly folded)
54               line which is terminated by a new-line.
55
56           ·   new NAME, (BODY|OBJECTS), [ATTRIBUTES]
57
58               A set of values which shape the line.
59
60           Create a new header field object.  Specify the whole LINE at once,
61           and it will be split-up for you.  I case you already have the parts
62           of the header line, you may specify them separately as NAME and
63           BODY.
64
65           In case you specify a single OBJECT, or a reference to an array of
66           OBJECTS, these objects are processed to become suitable to fill a
67           field, usually by simple strification.  When you specify one or
68           more Mail::Address objects, these are transformed into a string
69           using their "format" method.  You may also add one
70           Mail::Message::Field, whose body is taken.  In case of an array,
71           the elements are joined into one string with a comma.
72
73           ATTRIBUTES can be exactly one string which may contain multiple
74           attributes at once, quoted and formatted as required in RFC2822.
75           As alternative, list of key-value pairs can be used.  In this case,
76           the values will get quoted if needed and everything formatted as
77           the protocol demands.
78
79            -Option--Defined in     --Default
80             log     Mail::Reporter   <disabled>
81             trace   Mail::Reporter   <disabled>
82
83           log => LEVEL
84           trace => LEVEL
85
86           example:
87
88            my $mime = Mail::Message::Field->new(
89             'Content-Type: text/plain; charset=US-ASCII');
90
91            my $mime = Mail::Message::Field->new(
92             'Content-Type' => 'text/plain; charset=US-ASCII');
93
94            my $mime = Mail::Message::Field->new(
95             'Content-Type' => 'text/plain', 'charset=US-ASCII');
96
97            my $mime = Mail::Message::Field->new(
98             'Content-Type' => 'text/plain', charset => 'Latin1');
99
100            my $mime = Mail::Message::Field->new(
101             To => Mail::Address->new('My', 'me@example.com');
102
103            my $mime = Mail::Message::Field->new(
104             Cc => [ Mail::Address->new('You', 'you@example.com')
105                   , Mail::Address->new('His', 'he@example.com')
106                   ]);
107
108           But in practice, you can simply call
109
110            my $head = Mail::Message::Head->new;
111            $head->add( 'Content-Type' => 'text/plain'
112                      , charset => 'utf8');
113
114           which implicitly calls this constructor (when needed).  You can
115           specify the same things for Mail::Message::Head::Complete::add() as
116           this "new" accepts.
117
118   The field
119       $obj->isStructured
120           Mail::Message::Field::Fast->isStructured
121
122           See "The field" in Mail::Message::Field
123
124       $obj->length
125           See "The field" in Mail::Message::Field
126
127       $obj->nrLines
128           See "The field" in Mail::Message::Field
129
130       $obj->print([FILEHANDLE])
131           See "The field" in Mail::Message::Field
132
133       $obj->size
134           See "The field" in Mail::Message::Field
135
136       $obj->string([WRAP])
137           See "The field" in Mail::Message::Field
138
139       $obj->toDisclose
140           See "The field" in Mail::Message::Field
141
142   Access to the name
143       $obj->Name
144           See "Access to the name" in Mail::Message::Field
145
146       $obj->name
147           See "Access to the name" in Mail::Message::Field
148
149       $obj->wellformedName([STRING])
150           See "Access to the name" in Mail::Message::Field
151
152   Access to the body
153       $obj->body
154           See "Access to the body" in Mail::Message::Field
155
156       $obj->folded
157           See "Access to the body" in Mail::Message::Field
158
159       $obj->foldedBody([BODY])
160           See "Access to the body" in Mail::Message::Field
161
162       $obj->stripCFWS([STRING])
163           Mail::Message::Field::Fast->stripCFWS([STRING])
164
165           See "Access to the body" in Mail::Message::Field
166
167       $obj->unfoldedBody([BODY, [WRAP]])
168           See "Access to the body" in Mail::Message::Field
169
170   Access to the content
171       $obj->addresses
172           See "Access to the content" in Mail::Message::Field
173
174       $obj->attribute(NAME [, VALUE])
175           See "Access to the content" in Mail::Message::Field
176
177       $obj->attributes
178           See "Access to the content" in Mail::Message::Field
179
180       $obj->comment([STRING])
181           See "Access to the content" in Mail::Message::Field
182
183       $obj->study
184           See "Access to the content" in Mail::Message::Field
185
186       $obj->toDate([TIME])
187           Mail::Message::Field::Fast->toDate([TIME])
188
189           See "Access to the content" in Mail::Message::Field
190
191       $obj->toInt
192           See "Access to the content" in Mail::Message::Field
193
194   Other methods
195       $obj->dateToTimestamp(STRING)
196           Mail::Message::Field::Fast->dateToTimestamp(STRING)
197
198           See "Other methods" in Mail::Message::Field
199
200   Internals
201       $obj->consume(LINE | (NAME,BODY|OBJECTS))
202           See "Internals" in Mail::Message::Field
203
204       $obj->defaultWrapLength([LENGTH])
205           See "Internals" in Mail::Message::Field
206
207       $obj->fold(NAME, BODY, [MAXCHARS])
208           Mail::Message::Field::Fast->fold(NAME, BODY, [MAXCHARS])
209
210           See "Internals" in Mail::Message::Field
211
212       $obj->setWrapLength([LENGTH])
213           See "Internals" in Mail::Message::Field
214
215       $obj->stringifyData(STRING|ARRAY|OBJECTS)
216           See "Internals" in Mail::Message::Field
217
218       $obj->unfold(STRING)
219           See "Internals" in Mail::Message::Field
220
221   Error handling
222       $obj->AUTOLOAD
223           See "Error handling" in Mail::Reporter
224
225       $obj->addReport(OBJECT)
226           See "Error handling" in Mail::Reporter
227
228       $obj->defaultTrace([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
229           Mail::Message::Field::Fast->defaultTrace([LEVEL]|[LOGLEVEL,
230           TRACELEVEL]|[LEVEL, CALLBACK])
231
232           See "Error handling" in Mail::Reporter
233
234       $obj->errors
235           See "Error handling" in Mail::Reporter
236
237       $obj->log([LEVEL [,STRINGS]])
238           Mail::Message::Field::Fast->log([LEVEL [,STRINGS]])
239
240           See "Error handling" in Mail::Reporter
241
242       $obj->logPriority(LEVEL)
243           Mail::Message::Field::Fast->logPriority(LEVEL)
244
245           See "Error handling" in Mail::Reporter
246
247       $obj->logSettings
248           See "Error handling" in Mail::Reporter
249
250       $obj->notImplemented
251           See "Error handling" in Mail::Reporter
252
253       $obj->report([LEVEL])
254           See "Error handling" in Mail::Reporter
255
256       $obj->reportAll([LEVEL])
257           See "Error handling" in Mail::Reporter
258
259       $obj->trace([LEVEL])
260           See "Error handling" in Mail::Reporter
261
262       $obj->warnings
263           See "Error handling" in Mail::Reporter
264
265   Cleanup
266       $obj->DESTROY
267           See "Cleanup" in Mail::Reporter
268
269       $obj->inGlobalDestruction
270           See "Cleanup" in Mail::Reporter
271

DIAGNOSTICS

273       Warning: Field content is not numerical: $content
274           The numeric value of a field is requested (for instance the "Lines"
275           or "Content-Length" fields should be numerical), however the data
276           contains weird characters.
277
278       Warning: Illegal character in field name $name
279           A new field is being created which does contain characters not
280           permitted by the RFCs.  Using this field in messages may break
281           other e-mail clients or transfer agents, and therefore mutulate or
282           extinguish your message.
283
284       Error: Package $package does not implement $method.
285           Fatal error: the specific package (or one of its superclasses) does
286           not implement this method where it should. This message means that
287           some other related classes do implement this method however the
288           class at hand does not.  Probably you should investigate this and
289           probably inform the author of the package.
290

SEE ALSO

292       This module is part of Mail-Box distribution version 2.097, built on
293       January 26, 2011. Website: http://perl.overmeer.net/mailbox/
294

LICENSE

296       Copyrights 2001-2011 by Mark Overmeer. For other contributors see
297       ChangeLog.
298
299       This program is free software; you can redistribute it and/or modify it
300       under the same terms as Perl itself.  See
301       http://www.perl.com/perl/misc/Artistic.html
302
303
304
305perl v5.12.3                      2011-01-26     Mail::Message::Field::Fast(3)
Impressum