Might be OT - File::Find not reading tt files
Summer <crazysummer2004-/[email protected]> Mon, 21 May 2012 11:49:48 -0700 (PDT)
| Newsgroups | gmane.comp.lang.perl.modules.template-toolkit |
|---|---|
| Message-ID | <[email protected]> |
Hey All,
If this is OT, please disregard but I thought to ask here to see if this is a known issue or others have encountered this. Perhaps I am missing something.
I am using TT for all my pages and I am trying to create a simple shell script that will scan all the tt files for a query match that I pass in.
I am using the module File::Find
The directories/files are traversed via the package but when I try to print out the actual contents of the <FILE> it is empty. I am thinking that the [% etc.. are somehow preventing reading in off all the data in the file.
Here is a snippet I have:
print "Your Results are as Follows:\n";
find( sub
{
return if ($_ =~ /^\./);
return unless ($_ =~ /\.tt$/i);
stat $File::Find::name;
return if -d;
return unless -r;
open(FILE, "< $File::Find::name") or return;
print "$File::Find::name\n";
my $string = <FILE>;
close (FILE);
#print "$string\n";
return unless ($string =~ /$pagepos/i);
print "Found Match: $File::Find::name\n";
Any ideas?
Thanks
_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates