my @lines = ; print pop(@lines) for (0 .. @lines); __DATA__ 1. text'1' 2. text'2' 3. text'3'