>>    # match mail time format
>>    elsif ($Param{String} =~
>>/((...),\s+|)(\d\d|\d)\s(...)\s(\d\d\d\d)\s(\d\d|\d):(\d\d|\d):(\d\d|\d)\s((\+|\-)(\d\d)(\d\d)|...)/

> It matches the  beginning of a date in a mail message. ie:
> 
> Date: Thu, 22 Dec 2005 23:07:24 -0500 (EST)


> The 'pipe symbol' is a logical OR. That part of the regexp says
> "anything followed by a space OR nothing".

This is stupid. Then use "\s*".

I'm not sure if the pipe groups inside the bracket, so that the first
part is:

- match 3 chars (...) followed by comma (and spaces)
OR
- nothing at all

I think the pipe inside a bracket groups the entire part regexpes. So
this regexp is WRONG.

> I think the whole if/elsif block should be commented out, since it's
> not actually doing anything. It looks like the regexp has changed
> number of parameters since the if/elsif block was last used (I can't
> see how $10 would ever be + or -, isn't it the first 2 digits of the
> timezone?).

The last bracket has the same problem with the pipe. It matches the
timezone OR 3 chars.

If it doesn't match the timezone (e. g. there is no timezone) then $10
doesn't get populated. So comes the warning when comparing $10 to '+' or
'-'.

Someone with commit rights, please care about this. Change it or use a
CPAN module for date parsing. There are plenty of them.


Thanks,
bye, Uwe
_______________________________________________
OTRS mailing list: dev - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/dev
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/dev

Reply via email to