CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Need a Custom or Prewritten Perl Program?: I need a program that...: Re: [fhare] recursivly matching string (a filename) in file, then testing said filename for same string, etc, etc...: Edit Log



stenrap
Novice

Jul 24, 2008, 12:04 AM


Views: 2839
Re: [fhare] recursivly matching string (a filename) in file, then testing said filename for same string, etc, etc...

How about something like this? All you have to do is call the checkFile() method, specifying the first file to be checked, and call the method you already have for parsing files:


Code
checkFile($firstFile); 

sub checkFile
{
my $fileToCheck = shift; # Get the name of the file to be checked
my $nextFile = # Call method which 1) parses $fileToCheck for "jsp:include=filename.inc", and 2) returns the next "filename.inc" or undef
checkFile($nextFile) if -e $nextFile; # Recursive call to check for next file...
}



(This post was edited by stenrap on Jul 24, 2008, 12:06 AM)


Edit Log:
Post edited by stenrap (Novice) on Jul 24, 2008, 12:04 AM
Post edited by stenrap (Novice) on Jul 24, 2008, 12:06 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives