require

The require statement replaces itself with the specified file, much like the C preprocessor's #include works.

This means that you can't put a require statement inside of a loop structure and expect it to include the contents of a different file on each iteration. To do that, use an include statement.

 require 'header.inc';