Hello Monks,
I am trying to parse a text file that has many lines beginning with # (pound character). When I read the file and print the lines out, it seems to ignore all of those lines. For instance, here's the contents of my history.txt file:
#EXTM3U #EXTINF:547,Excerpt from the Binti Excerpt from the Binti novella series by Nnedi Okorafor.mp3
when I read this file, and print each line, I only see:
Excerpt from the Binti novella series by Nnedi Okorafor.mp3
The lines beginning with # are ignored; here's my code:
#! /usr/bin/perl use strict; my $history = shift; open my $fh, "<:encoding(utf8)", "$history" or die "$history: $!"; while (my $line=<$fh>){ print $line; } close($fh); exit;
I'm on Windows 10 using Strawberry Perl version 30, subversion 1 (v5.30.1). Am I doing something wrong? Thanks for any advice.
In reply to Reading lines beginning with pound # ignored by slugger415
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |