$str = '5-29@foobar@invalid.com@ZZ88-6@550 5.1.1 <foobar@invalid.com>... User Unknow@GGH93';
#$str= '2012-05-29@joedoe@example.com@AB99-5@440 4.4.1 Some error occurred@XYZ35';
$str =~ s/(\<[^\>]+\>)/!!/; # replace an email address with !!
$email = $1; # store the email
@fields = split(/@/,$str); # split on @
s/!!/$email/ foreach (@fields); # find the old !! and replace with the email address
print STDERR map { "$_ \n" } @fields; # print fields to standard error