Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Best way to compare range of characters in two text files

by tybalt89 (Monsignor)
on Jul 12, 2018 at 13:36 UTC ( [id://1218374]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1218374]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-03-28 18:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found