#!/usr/bin/perl -w use strict; open (LEASE, "lease.file") or die "Unable to open input file : $!"; $/ = "\n}\n"; while (defined (my $lease = )) { next unless ($lease =~ /Telephone/); print $lease; } #### while (defined (my $lease = )) { next unless ($lease =~ /Telephone/); foreach my $line (split /\n/ , $lease) { # Do something with the line? print $line, "\n"; } }