[vhffs-dev] [779] use regexps instead splits |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
Revision: 779
Author: gradator
Date: 2007-08-27 19:15:30 +0000 (Mon, 27 Aug 2007)
Log Message:
-----------
use regexps instead splits
Modified Paths:
--------------
trunk/vhffs-listengine/src/listengine.pl
Modified: trunk/vhffs-listengine/src/listengine.pl
===================================================================
--- trunk/vhffs-listengine/src/listengine.pl 2007-08-27 19:04:52 UTC (rev 778)
+++ trunk/vhffs-listengine/src/listengine.pl 2007-08-27 19:15:30 UTC (rev 779)
@@ -134,10 +134,9 @@
$month = '0'.$month if( $month < 9 );
$day = '0'.$day if( $day < 9 );
-# my ( $message_id )= ($mail->get( 'Message-Id' ) =~ /^<(.+)>$/);
my $message_id = $mail->get( 'Message-Id' );
- ( undef , $message_id ) = split( /</ , $message_id , 2);
- ( $message_id , undef ) = split( />/ , $message_id , 2);
+ $message_id =~ s/^<//;
+ $message_id =~ s/>$//;
#Don't archive if message-id is not found
return if( ( ! defined $message_id ) || ( $message_id eq "" ) );
@@ -160,10 +159,9 @@
my $members = $list->get_members;
my $header;
my $email;
-# my ( $message_id )= ($mail->get( 'Message-Id' ) =~ /^<(.+)>$/);
my $message_id = $mail->get( 'Message-Id' );
- ( undef , $message_id ) = split( /</ , $message_id , 2);
- ( $message_id , undef ) = split( />/ , $message_id , 2);
+ $message_id =~ s/^<//;
+ $message_id =~ s/>$//;
my $from = ( $mail->get('From') =~ /(([\+\.a-zA-Z_\-0-9^\s]+)@([\.a-zA-Z_\-0-9^\s]+)\.(\w+))/);
my $directory = get_moderation_dir( $list );
my $subject = $mail->get('Subject');