all dhp script

#!/usr/bin/perl -w
use strict;

use lib $ENV{'FPERLLIB'};
use Fmp3;
use Fhtm;

use File::Find;

my $outstr = Fhtm::header("mc assist");

##################################################################
sub do_something_with_file
{
  # $File::Find::dir  = /some/path/
    #$_                = foo.ext
    #$File::Find::name = /some/path/foo.ext
    my $ffn = $File::Find::name;
   
    #print "$File::Find::name \n";
    if ($ffn =~ m/\.mp3\s*$/i) { # is an mp3 file
        print "found $ffn\n";
        my $filename = $ffn; #"kn-dhp05-balavagga-eng-budd-rdrbkh.mp3";
        #my $indexpath = 'http://www.audtip.org/home/mn';       
        my $indexpath = 'http://www.audtip.org/home/kn/kn-dhp/bkh2011';       
        Fmp3::mc($filename);
        #mc($filename);
        $outstr   .= Fmp3::mc($filename, $_ , $indexpath);
        Fhtm::write_file("mcassist.html", $outstr);
    }   
} #sub
 
#################################################################################
my $dir = "."; # whatever you want the starting directory to be

find(\&do_something_with_file, $dir);

Comments