in reply to Best way to compare range of characters in two text files

sub compare50 { my ($file1, $file2) = @_; local $/ = \50; return do {local @ARGV = $file1; <> } eq do {local @ARGV = $file2; < +> }; }

untested...

Replies are listed 'Best First'.
Re^2: Best way to compare range of characters in two text files
by LanX (Saint) on Jul 12, 2018 at 16:55 UTC
    >  $/ = \50;

    Thanks, learned something new about the $INPUT_RECORD_SEPARATOR today. :)

    perlvar $/

    Setting $/ to a reference to an integer ... will attempt to read records instead of lines ...

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

A reply falls below the community's threshold of quality. You may see it by logging in.