There's more than one way to do things | |
PerlMonks |
`diff`ing two files (code)by deprecated (Priest) |
on Jul 20, 2001 at 20:28 UTC ( [id://98459]=perlquestion: print w/replies, xml ) | Need Help?? |
deprecated has asked for the wisdom of the Perl Monks concerning the following question:
I am faced with the "worse is better" way in my current project. I have a piece of code that creates files with several thousand checksums in it.
One of the things it does is open a file thusly: whereas I decided to use a hash and ditch the sort (1). This has been mostly successful, and cleaned up other areas of the code. I have a new problem in a similar vein, however: using diff (1) is very tempting, but I would rather not use any system calls in this case. I am, however, faced with adding, say, 10 lines of code instead of just using the diff. I know that this is why the "worse is better" approach is sometimes taken by programmers, and I may just use it. But I'd really like to know if somebody has a solution that is simple and clear... Or opinions on using diff in this case <!- except I dont want to hear from you, tilly... ->.
thanks
--
Back to
Seekers of Perl Wisdom
|
|