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

Invalid Perl code

Name: Anonymous 2008-03-24 22:51

Oh man, it's 3:50 am and I have to stop working on this now. Posting its current state for your entertainment. Laugh at me if you want. Fix it if you want. I'll continue with it anyways.

#!/usr/bin/perl -w

if(@ARGV < 1){
        die "fd: This doesn't make too much sense now, does it...\n";
}

$relative_dir=$ARGV[0];

chomp(my @files = `ls -FA $ARGV[0]`);

foreach(@files){
        if(m/(.*)\*$/){
                $current_file = $1;
                next;
        } 
        elsif(m/[\/\@\|\=]$/){
                next;
        } 
        else{
                $current_file = $_;
        } 

        $current_file = $relative_dir . $_;
        chomp($sum = `md5sum $current_file | cut -d" " -f1`);
        #printf "%50s\t%s\n", $current_file, $sum;
        if(defined $md5sums{$sum}){
                print "$current_file seems to be a copy of $md5sums{$sum}\n";
        } 
        $md5sums{$sum} = $current_file;
}

Name: Anonymous 2008-03-24 23:41

>>3
Real programmers don't use indentation at all. It's for idiots and kids who can't understand code by just reading it.

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