in reply to Determine files added/removed (code for magazine article)
ouch, those comments hurt my eyes! consider using the __END__ marker and you can follow with all the free text you want.
# Lines 4 and 5 are good Perl practice. "strict" and "warnings" are p +ragmas # that help prevent Perl programmers from doing silly things in their +programs. #
becomes
__END__ Lines 4 and 5 are good Perl practice. "strict" and "warnings" are pra +gmas that help prevent Perl programmers from doing silly things in their pr +ograms. <code> <p>also, you might consider using here documents rather than multiple +print statements.</p> <code> print OUT "For unique files in OldInventory.txt:\n"; print OUT "IGNORING FILES WITH Tmp OR Temp IN PATHNAME.\n"; print OUT "IGNORING FILES IN THE RECYCLE BIN.\n"; print OUT "IGNORING ALL HISTORY FILES.\n"; print OUT "LOWERCASING ALL FILE AND PATHNAMES BEFORE COMPARING.\n"; print OUT "\n";
becomes clearer, and more maintainable as
print OUT <<EOT; For unique files in OldInventory.txt: IGNORING FILES WITH Tmp OR Temp IN PATHNAME. IGNORING FILES IN THE RECYCLE BIN. IGNORING ALL HISTORY FILES. LOWERCASING ALL FILE AND PATHNAMES BEFORE COMPARING. EOT
it's one more useful concept to teach a user, and not difficult to understand.
~Particle *accelerates*
|
---|
Replies are listed 'Best First'. | |
---|---|
2Re: Reviewed code reviewed again
by jeffa (Bishop) on Apr 16, 2004 at 04:55 UTC | |
by McMahon (Chaplain) on Apr 16, 2004 at 22:15 UTC | |
Re: Re: Reviewed code reviewed again
by Anonymous Monk on Apr 16, 2004 at 04:52 UTC |
In Section
Cool Uses for Perl