use warnings; use strict; my $ts = '10.72.184.159:disk_data_written'; { local $/ = ''; # paragraph mode while ( my $para = ) { next unless $para =~ /$ts/; $para =~ s/^Timestamp.+\n//; $para =~ s/^--+//; print "\nThe timestamp array for \"$ts\" consists of :\n$para"; } } __DATA__ Timestamp 10.72.184.159:cpu_busy -------------------------------------------------- 2010-01-05 22:49:03 1.707 2010-01-05 22:50:04 1.753 2010-01-05 22:51:03 1.994 2010-01-05 22:52:03 1.726 2010-01-05 22:53:03 1.783 2010-01-05 22:54:03 1.733 2010-01-05 22:55:03 1.742 2010-01-05 22:56:03 1.902 2010-01-05 22:57:03 1.902 Timestamp 10.72.184.159:disk_data_written ----------------------------------------------------- 2010-01-05 22:49:03 47.467 2010-01-05 22:50:04 43.148 2010-01-05 22:51:03 47.186 2010-01-05 22:52:03 45.867 2010-01-05 22:53:03 47.333 2010-01-05 22:54:03 47.067 2010-01-05 22:55:03 42.400 2010-01-05 22:56:03 46.533 Timestamp 10.72.184.159:disk_data_read --------------------------------------------------------- 2010-01-05 22:49:03 13.467 2010-01-05 22:50:04 10.557 2010-01-05 22:51:03 10.712 2010-01-05 22:52:03 10.733 2010-01-05 22:53:03 10.667 2010-01-05 22:54:03 12.667 2010-01-05 22:55:03 10.133 2010-01-05 22:56:03 10.000 2010-01-05 22:57:03 10.133