in reply to Re^2: feed File::Find::Name from a list
in thread feed File::Find::Name from a list

Thanks for your perls of wisdom but i'm getting the same "Global symbol "$jpglist" requires explicit package" name errors i got befor. I copied / pasted your thoughts to get the following so what am i doing wrong?
use strict; use File::Find; my @directories = (".", "I:\\temp\\"); my @foun0dfiles; print "Please drag error list \n\t\t"; chop($jpglist=<STDIN>); open (JPG, "$jpglist") || die "can't open JPG"; @jpeg = <JPG>; close(JPG); chomp(@jpeg) my $pattern = join("|", @jpeg); find( sub { push @foundfiles, $File::Find::name if /$pattern/o }, @dir +ectories ); open (OUT, ">>I:\\temp\\Outlist1.txt") || die "can't open jpgfiles"; print OUT join("\n",@foundfiles), "\n"; close(OUT);

Replies are listed 'Best First'.
Re^4: feed File::Find::Name from a list
by cyclist38 (Hermit) on Oct 06, 2004 at 08:47 UTC
Re^4: feed File::Find::Name from a list
by jdalbec (Deacon) on Oct 05, 2004 at 22:15 UTC
    use diagnostics; gives a little more info:
    (F) You've said "use strict vars", which indicates that all variables must either be lexically scoped (using "my"), declared beforehand using "our", or explicitly qualified to say which package the global variable is in (using "::").
    Also, you should use chomp instead of chop to strip off a trailing newline. So you need something like chomp(my $jpglist=<STDIN>);.