-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm trying to setup a script to recursively step through a directory and
take action on files and directories.&nbsp; Pretty simple, eh?&nbsp; <br/>
<br/>
My script runs perfectly well and can handle the files and directory
entries differently, it is only when I recursively call the subroutine
that it fails.&nbsp; The script recursively dives into the sub-directory,
but when it is done with that directory the recursive call appears to kill
the whole loop.<br/>
<br/>
Here is my code -- what am I missing?<br/>
<br/>
<pre>     1        #!/bin/perl -w<br/>
2        use strict;<br/>
3        <br/>
4        sub ProcFiles {<br/>
5                my $dir = shift;<br/>
6        <br/>
7                opendir (DIR, $dir) or die $!;<br/>
8        <br/>
9                while (my $file = readdir(DIR)) {<br/>
10                        next if ( -d &quot;$dir/$file&quot; &amp;&amp;
$file =~ /^\./);<br/>
11                        if (-d &quot;$dir/$file&quot;) {<br/>
12                                printf (&quot;Diving into
\&quot;%s/%s\&quot;.\n&quot;, $dir, $file);<br/>
13
&amp;ProcFiles(&quot;$dir/$file&quot;);<br/>
14                                next;<br/>
15                        }<br/>
16        <br/>
17                        printf (&quot;Adding
\&quot;%s/%s\&quot;.\n&quot;, $dir, $file);<br/>
18                }<br/>
19        <br/>
20                closedir(DIR);<br/>
21        }<br/>
22        <br/>
23        &amp;ProcFiles (&quot;/tmp&quot;);</pre>
Dan<br/>
<br/>
<br/>
- - - - -<br/>
&quot;Wait for that wisest of all counselors, time.&quot; -- Pericles<br/>
&quot;I do not fear computer, I fear the lack of them.&quot; -- Isaac
Asimov<br/>
GPG fingerprint:6FFD DB94 7B96 0FD8 EADF  2EE0 B2B0 CC47 4FDE 9B68

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFDehwesrDMR0/em2gRAmPOAKCFjcQ3dUGuDjPx1jrr8xPDT57JegCgg/W6
mNoWjzNdW7e1BjjoP0x6VdE=
=kDJ/
-----END PGP SIGNATURE-----