in reply to Returning Line where Characters Have been found

And you can also use grep for this

@lines_with_my_pattern = grep(/my_pattern/, @all_lines);