in reply to Re^2: Includes within includes
in thread Includes within includes
You've got my $count twice (as strict will warn you.) The value of $count isn't going to make it out of the if statement, so your $count == 0 test will always succeed.
In your
the (\s+)? is obfusciated; \s* is much clearer and efficient.$main_file_line =~ /^(\s+)?include\s+"(.*)"$/
Are you sure you don't have any circular dependencies in your include statements? You aren't testing for them. If there is one... well, endless loops take a long time to finish. Also, how do you want to handle the case where there are overlapping dependencies? E.g, A includes B and C; B and C each include D. Do you really want D and its dependencies to be searched twice?
throop
|
|---|