open my $fp, "<", $titlefile or die "Can't open <$titlefile: $!"; my @lines = <$fp>; # now iterate over @lines