perl -pe 'goto LINE if /^2nd/' myfile #### $ perl -MO=Deparse -pe 'goto LINE if /^2nd/' myfile LINE: while (defined($_ = )) { goto LINE if /^2nd/; } continue { print $_; } -e syntax OK