http://qs321.pair.com?node_id=11113350


in reply to Re: HTML::HTML5::Parser weirdness
in thread HTML::HTML5::Parser weirdness

Thanks for reading my post and taking the trouble to reply.

I did show you exactly how I populated $filename of course:

for my $filename (@files)

but I expect you meant how I populated @files, which was using readdir

opendir my $dir, $BASE_DIR or die "Cannot open $BASE_DIR directory: $! +"; my @all_files = readdir $dir; closedir $dir; my @files = sort grep { $_ =~ /\-00:/ } @all_files;

I didn't think that was important, since I specifically said I'd checked the file existed and I even posted some of its contents. And the fact that the loop works for all the other files in that directory is a strong hint there's no whitespace problems or whatever.

But the fact that you got a similar error with a non-existent file suggests to me that the problem is in the module, which was why I looked for <head/> in /usr/lib/perl5. So I'll go and look further to see if I can isolate where that string is coming from.

While I appreciate the benefits of SSCCE, I think the effort I would need to construct one in this case outweighs the benefits. But I may do so if I'm still stuck after a while.

PS Why does perlmonks format code at column 70? I could vaguely understand column 72 if I was a punched-card FORTRAN programmer but I use an 80-column terminal and try to stay within that!

Replies are listed 'Best First'.
Re^3: HTML::HTML5::Parser weirdness
by GrandFather (Sage) on Feb 23, 2020 at 21:30 UTC
    While I appreciate the benefits of SSCCE, I think the effort I would need to construct one in this case outweighs the benefits.

    Because very often the process of creating a SSCCE will find the problem for you. In the process of creating a SSCCE you are forced to examine your assumptions. Often you will find they aren't correct. You also make it easy for us to reproduce your problem - why should we do all the work? See I know what I mean. Why don't you?.

    Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond
Re^3: HTML::HTML5::Parser weirdness
by choroba (Archbishop) on Feb 23, 2020 at 20:44 UTC
    > Why does perlmonks format code at column 70?

    You can configure that in the Display Settings.

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
      Ah, thanks! :) 70 still seems a strange default, but there's plenty of bigger things to worry about :)