On 8/31/07, Somu <[EMAIL PROTECTED]> wrote: > It gave the error > > Use of uninitialized value in pattern match (m//) at test.pl line 13. > Can't use string ("") as a subroutine ref while "strict refs" in use > at C:/Perl/lib/File/Find.pm line 822. > > > ??? > > On 8/29/07, Omega -1911 <[EMAIL PROTECTED]> wrote: > > On 8/28/07, Randal L. Schwartz <[EMAIL PROTECTED]> wrote: > > > >>>>> "Somu" == Somu <[EMAIL PROTECTED]> writes: > > > > > > Somu> Good sense of humour! Actually i wanted to search for F:/Hindi/RHTDM > > > Somu> and i entered only /Hindi/RHTDM/ > > > > > > Why did you do that? I think you have to enter the full path on Windows. > > > > > > However, I don't run Windows (anywhere!) so I can't actually answer that > > > except via common sense. > > > >Ha! Here is a snippet that I use on a windows machine. It works!!! > > > > use File::Find; > > > > sub rm(); > > $$count = 0; > > @directories = ("F://Hindi/RHTDM"); > > find(&rm, @directories); > > > > sub rm() { > > $$count++; > > my ($$filename) = $$_; > > if ($$filename =~ /jpg/) { > > print "$$count $$filename "; > > } > > print " ----------- ALL DONE-----------";
Why not use the original code snippet I gave you ;) #---------------------------------------------------------------# use File::Find; sub rm(); $count = 0; @directories = ("F://Hindi/RHTDM"); find(\&rm, @directories); sub rm() { $count++; my ($filename) = $_; if ($filename =~ /jpg/) { print "$count\t$filename\n"; } print "\n\n----------- ALL DONE-----------"; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/