in reply to Reading lines beginning with pound # ignored

Try this:

#! /usr/bin/perl use strict; my $history = shift; open my $fh, "<:encoding(utf8)", "$history" or die "$history: $!"; while (my $line=<$fh>){ $line =~ tr/\r/\n/; # NOTE convert carriage returns to new lines print $line; } close($fh); exit;

and see what you get.

EDIT: apply transliteration to proper variable.

Replies are listed 'Best First'.
Re^2: Reading lines beginning with pound # ignored
by kcott (Archbishop) on Jun 18, 2023 at 13:10 UTC

    Your transliteration operates on $_ which is uninitialised. You'd get a warning with "use warnings;". You want:

    $line =~ tr/\r/\n/;

    — Ken

Re^2: Reading lines beginning with pound # ignored
by slugger415 (Monk) on Jun 18, 2023 at 16:47 UTC

    Awesome! transliteration did the trick, thank you!