in reply to Extracing (and excluding) IP's from a file

if the order of categories is preserved for all the files - you can wait until 'vfiler1' is encountered and afterwards start getting the IPs:
open (FaH, "/tmp/vflist1.out"); my $flag = 0; while ( <FaH> ) { chomp; if($flag == 0) { if($_ =~ /vfiler1/) { $flag = 1; } if($flag == 0) { next; } } if (m/{[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}}/) { $ip=$1; print FaHout "$ip\n"; } }