#!/usr/bin/perl -w use strict; local $/; my $line = ; if($line=~m/(\d+):\s+From:\s+(.*?)(?=Length)/s){ print $1 . $2; } 1; __DATA__ There is a new voicemail in mailbox 11234567890: From: "Unknown" Length: 0:13 seconds Date: Thursday, January 19, 2006 at 11:35:01 AM #### perl hate.pl 11234567890"Unknown"