<?xml version="1.0" encoding="windows-1252"?>
<node id="1203" title="perlman:File::CheckTree" created="1999-12-22 19:51:48" updated="2005-08-10 16:40:07">
<type id="119">
perlfunc</type>
<author id="113">
root</author>
<data>
<field name="doctext">
</field>
<field name="name">

&lt;P&gt;
validate - run many filetest checks on a tree

&lt;P&gt;
&lt;HR&gt;
</field>
<field name="synopsis">

&lt;P&gt;
&lt;PRE&gt;    use &lt;A HREF="File::CheckTree"&gt;File::CheckTree&lt;/A&gt;;
&lt;/PRE&gt;
&lt;P&gt;
&lt;PRE&gt;    $warnings += validate( q{
        /vmunix                 -e || die
        /boot                   -e || die
        /bin                    cd
            csh</field>
<field name="description">

&lt;P&gt;
The 
&lt;CODE&gt;validate()&lt;/CODE&gt; routine takes a
single multiline string consisting of lines containing a filename plus a
file test to try on it. (The file test may also be a ``cd'', causing
subsequent relative filenames to be interpreted relative to that
directory.) After the file test you may put [perlfunc:die|die] to make it a fatal error if the file test fails. The default is [perlman:perlguts|perlguts]. The file test may optionally have a ``!' prepended to test for the opposite condition. If you do a cd and then list some relative filenames, you may want to indent them slightly for readability. If you supply your own 
&lt;CODE&gt;die()&lt;/CODE&gt; or 
&lt;CODE&gt;warn()&lt;/CODE&gt; message, you can use &lt;CODE&gt;$file&lt;/CODE&gt; to interpolate the filename.

&lt;P&gt;
Filetests may be bunched: ``-rwx'' tests for all of &lt;CODE&gt;-r&lt;/CODE&gt;, &lt;CODE&gt;-w&lt;/CODE&gt;, and &lt;CODE&gt;-x&lt;/CODE&gt;. Only the first failed test of the bunch will produce a warning.

&lt;P&gt;
The routine returns the number of warnings issued.

&lt;HR&gt;
</field>
</data>
</node>
