3 validate - run many filetest checks on a tree
9 $warnings += validate( q{
17 /usr -d || warn "What happened to $file?\n"
22 The validate() routine takes a single multiline string consisting of
23 lines containing a filename plus a file test to try on it. (The
24 file test may also be a "cd", causing subsequent relative filenames
25 to be interpreted relative to that directory.) After the file test
26 you may put C<|| die> to make it a fatal error if the file test fails.
27 The default is C<|| warn>. The file test may optionally have a "!' prepended
28 to test for the opposite condition. If you do a cd and then list some
29 relative filenames, you may want to indent them slightly for readability.
30 If you supply your own die() or warn() message, you can use $file to
31 interpolate the filename.
33 Filetests may be bunched: "-rwx" tests for all of C<-r>, C<-w>, and C<-x>.
34 Only the first failed test of the bunch will produce a warning.
36 The routine returns the number of warnings issued.