Snipplrhttp://snipplr.com/language/perl/tags/tools
Recent snippets posted on Snipplr.comen-usThu, 22 Feb 2018 16:21:30 GMT(Perl) Detect PHP files with trailing whitespace, using Perl - noahhttp://snipplr.com/view/46218/detect-php-files-with-trailing-whitespace-using-perl/
The following incantation returns nonzero exit status when the terminating `?>` of a PHP file, is followed by whitespace. ]]>Wed, 29 Dec 2010 08:25:03 GMThttp://snipplr.com/view/46218/detect-php-files-with-trailing-whitespace-using-perl/(Perl) Remove duplicate lines from a text file with Perl - noahhttp://snipplr.com/view/3124/remove-duplicate-lines-from-a-text-file-with-perl/
*[Found at Google Answers.](http://answers.google.com/answers/threadview?id=25196)*
Sometimes I get a big list of things, and some of the things occur multiple times in the same list. To make the list easier to read, I want to *delete* the duplicate lines.
A good example is a list of files that have errors (maybe excerpted from an application sever's log files). In that case you have a newline-delimited list of file paths, and depending upon the situation, the same file path might be listed 4 or 5 times or more. Often, it is useful to have a list of just the files that are faulty, which can be produced by deleting all the duplicate lines. This script is for filtering just those kinds of list files.
[Of course,](http://xkcd.com/378/ "emacs has a command for that") for **Emacs** users [there is a much easier way to remove duplicate lines:](http://everything2.com/title/useful%2520emacs%2520lisp%2520functions "useful emacs lisp functions"), if you have `uniq` installed on your system.
`M-x sort-lines RET C-x h M-x shell-command-on-region RET uniq RET` ]]>Tue, 03 Jul 2007 22:06:34 GMThttp://snipplr.com/view/3124/remove-duplicate-lines-from-a-text-file-with-perl/(Perl) rename - Larry Wall's filename fixer - noahhttp://snipplr.com/view/2677/rename--larry-walls-filename-fixer/
Invoke this script without any arguments to see the help text. From the Perl Cookbook, Ch. 9.9. ]]>Mon, 21 May 2007 04:49:45 GMThttp://snipplr.com/view/2677/rename--larry-walls-filename-fixer/