while (<>){ if (/name/) { <>; #reads the line of dashes $whatIwant=<>;#grabs the next line "This is What I..." print $whatIwant; } }