in reply to Parsing a text file

In this line foreach my $line (my @stories){ the my makes a new copy of the array stories that is in effect for the lexical block of the foreach. Of course that new copy is empty rather than having the contents of the file in it. Use foreach my $line (@stories){ instead;

Replies are listed 'Best First'.
Re^2: Parsing a text file
by DARK SCIENTIST (Novice) on Apr 15, 2017 at 17:53 UTC
    What a mistake for me to make!! I read so much to learn how to take different approaches and I still make silly mistakes like that. Thanks a bunch for your reply huck