#!/usr/bin/perl -w use strict; open(FH,'-'); my $file = do {local $/; }; #A really elegant way to slurp an entire file and fast too. #It creates a "disposable subroutine" in effect. #I can't take credit for coming up with it though. close FH; open(FH2,">filename"); my $entry = $file =~ /:::(.*?):::/ms; #Thanks Corion print FH2 "$1\n";