Sven Verdoolaege wrote: > On Tue, Jul 10, 2007 at 07:02:43PM +0200, Uwe Kleine-König wrote: > > my ($recipient) = @_; > > - my ($recipient_name) = ($recipient =~ /^(.*?)\s+</); > > + my ($recipient_name, $recipient_addr) = ($recipient =~ /^(.*?)(\s+<.*)/); > > + > > + if ($recipient_name && $recipient_name =~ /[^-a-zA-Z0-9!*+\/ ]/ && $recipient_name !~ /=\?utf-8\?q?.*\?=/) { > > Why the extra test for truthness of $recipient_name ? Try: my $recipient = 'skimo@xxxxxxxxxx'; my ($recipient_name, $recipient_addr) = ($recipient =~ /^(.*?)(\s+<.*)/); print "Hoppla\n" if (!$recipient_name); i.e. if the pattern doesn't match, recipient_name is undefined. But the function could be simplyfied anyhow. e.g. if ($recipient_name) { ... do all the quoting ... return "$recipient_name$recipient_addr"; } else { return $recipient; } Best regards Uwe -- Uwe Kleine-König http://www.google.com/search?q=square+root+of+2 - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html