title: File Patterns
src: read_file( SELF )
sidebar: read_file( sidebar.inc )
files: file_glob( "img/*.jpg" )

<h2>File Patterns</h2>
<p>There is a special kind of per-page variable, using <tt>file_glob</tt>, which sets
up a data-structure which is used for a list.  Lists are documented fully in the
<a href="http://search.cpan.org/perldoc?HTML%3A%3ATemplate">HTML::Template</a>  documentation, but in brief if you have this structure:</p>
<p>You can setup a loop to hold the names of each file via:</p>
files: file_glob( "IMAGE*.jpg" )
<p>Then this, in your template, will allow you to see each of them:</p>
  &lt;!-- tmpl_loop name='files' --&gt;
   &lt;img src= "&lt;!-- tmpl_var name='file' --&gt;"&gt;
  &lt;!-- /tmpl_loop --&gt;
<p>Here is a live example:</p>

<!-- tmpl_loop name='files' -->
  <p><img src="<!-- tmpl_var name='file' -->" /></p>
<!-- /tmpl_loop -->