while(<>) { next until /vfiler1/; print (split)[2], "\n" if /^IP address:/; }