--- "Lile, James AZ2 (VAW-115)" <[EMAIL PROTECTED]> wrote: > > my code... > > $base = "c:\\www\\"; # the www is where the files are held on the unix > > server > > > > sub openDir { > > opendir(BASE, $base) || print "Error..."; > > while ($name = readdir(BASE)) { > > if (-d $name) { > > print "<a href =$name target=otherpage>$name</a> > > opendir(NEW, "$base$name") { > > ...
As a general rule, I would avoid writing a subroutine that has the same name as a built-in function (with the exception of the capital 'D'). In this case, I can't tell if the second and third calls to opendir are supposed to be to your subroutine or to the built-in functions. I also notice that the last opendir above does not actually check to see if the open was successful. I should also add that the standard way of handling this is to use the File::Find module. See 'perldoc File::Find' for more information. Cheers, Ovid ===== "Ovid" on http://www.perlmonks.org/ Web Programming with Perl: http://users.easystreet.com/ovid/cgi_course/ Silence Is Evil: http://users.easystreet.com/ovid/philosophy/decency.txt __________________________________________________ Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! http://platinum.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]