in reply to Applying a regular expression to a string

How about this?

my $message_id = do { local $_ = $message; (split)[0]; };

After Compline,
Zaxo