On Mon, 5 Apr 2004, David A Golden wrote:
> Generally, I think it would be useful to have Mail::Box be able to validate
> each of the major headers against these rules rather than to have users
> have to do it. (E.g., if $msg->validFrom() ). (Mark, how hard would this
> be to add?)
>
> For this purpose, where you don't really care if there is a header line or
> if it's blank because you're creating a report, I'd just use this kind of
> perl idiom:
>
> my $from = $head->get('From') || '';
You know it has been a long 6 months. I was thinking of all kinds of
silly ways to do this.
> I wouldn't want Mail::Box to give me empty strings instead of
> undefined as a blank header line is valid. There's really three (er,
> four) states. Present with valid contents, present with invalid
> contents, present and empty, and not-present. (With empty often just
> a subset of valid.)
Well since an empty From is OK (I don't think a missing From though) then
in that case it should return and empty string but in the case of missing
headers I agree it should be undef'd.
Rod
--
"Open Source Software - You usually get more than you pay for..."
"Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL"
|