Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

post bits of code you like

Name: Anonymous 2005-08-02 1:52

i shall start:

open(F,"find -type f|");
while (<F>) {
 $_ = substr($_,2,-1);
 print "$_\n" if $v;
 push @{$dups{substr(`md5sum -b "$_"`,0,31)}}, $_;
}
close(F);

for every file in a directory it checksums the file, then adds the checksum as a key to a hash, the value being an array reference. the filename is then added to the array.

so basically the arrays have a list of files with the same checksum. i use this to find duplicates files.

Name: Anonymous 2006-04-25 8:52

>>165
It's not good for you. Pick any other popular scripting language; the fact they're all better is a testament of Perl's shittiness. Okay, fine, PHP sucks more than Perl. Happy?

>>166
I don't like Python much, and I'd never use it for sysadmin tasks or text munging (outside of unicode, because I can tell you from first-hand experience that Perl sucks balls at unicode). The "pythonic way" is for fags.

But hey, if thinking I like Python makes you feel better about Perl, go right for it. Take some more stabs in the dark, it'll clearly make Perl stop sucking, right? All those ugly symbols, hundreds of nuances in syntax, nightmarish syntax for anything fancier than the basic data types, painful OO, and a million things I hope I'll never need to touch again, all of it will go away.

The only thing Perl still has going for it is CPAN, and the others are slowly catching up.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List