in reply to Re: How do I write NT perl script to search mult. dirs and output to a file?
in thread How do I write NT perl script to search mult. dirs and output to a file?
I keep getting the following SYNTAX error: Can't locate File/Recurse.pm in @INC (@INC contains: C:/Perl/lib C:/Perl/site/li b .) at C:\Rob\JHMCIS Scripts\MP3_Deletion.pl line 1. BEGIN failed--compilation aborted at C:\Rob\JHMCIS Scripts\MP3_Deletion.pl line 1.
*************************************
Here's my attempt:
open (MP3, ">c:\\perltest\\mp3log.txt"); recurse(\&Locate_MP3, "c:\\ "); close (MP3); sub Locate_MP3 # Recurses directory structure, #locates matching files, and deletes them(print to log #first, unlink +later after review). { if ( -f $_ ) { if ( $_ =~ /\.mp3$/i ) { # unlink ("$_") } } } print MP3 “$_ matches deletion criteria.\n”; # This was my first attempt at an array to do the same # thing. Only problem....only works on current directory. #open (MP3, ">c:\\perltest\\mp3test.txt"); #$timenow = time; #@mp3list = <c:\\perltest\\*.mp3>; #print MP3 "@mp3list\n"; #close (MP3);
Thanks,
Seeker of Perl Wisdom
|
|---|