in reply to Reading directory structure?
If you really want to eschew File::Find then you could try something like:
This is likely to break on a deep directory tree.#!/usr/bin/perl -w # + use strict; + + find('.'); + + sub find { my ( $dir ) = @_; + my $dh; + opendir $dh, $dir or return; + while(my $file = readdir $dh ) { next if $file =~ /^\.{1,2}$/; my $full_file = "$dir/$file"; if ( -d $full_file ) { find($full_file); } else { print "$full_file\n"; } } closedir $dh; }
/J\
|
|---|