Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^4: output using map

by Anonymous Monk
on Mar 07, 2020 at 06:57 UTC ( [id://11113930]=note: print w/replies, xml ) Need Help??


in reply to Re^3: output using map
in thread output using map

The sorting of keys (or, lines) does not help as the output would be out of sync from the order in a file. OP's code (after rewinding the file handle) would have printed the difference in lines in the same order as the lines appear in a file.

Use of hash in OP was a handy way to keep track of lines seen. I think to keep the order of lines printed was the reason that coding_new opened the same files twice. I personally would have generated the hash with line as key & $. as value. To print, then I would have sorted on the hash value. I personally would have used Algorithm::Diff.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2024-04-24 14:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found