All pastes #284269 Raw Edit

linux2

public text v1 · immutable
#284269 ·published 2006-12-18 23:56 UTC
rendered paste body
#!/usr/bin/perl

use strict;
use warnings;

#This script will populate the modradio.net website database nightly

my @all_files = </media/modarchive/*/*>;

use File::Basename; my @all_files_stripped = map basename($_), @all_files;

foreach my $file (@all_files_stripped) {

if ( $file !~ /\.mp3/ ) {
        my @grep = grep{  "$file.mp3" } @all_files_stripped;
        if (@grep != 0) {
                print "there is a mp3 availible of $file\n";
                print "Here is what grep returns: \n $grep[1] \n\n";
                }
        }
}
print "done";