in reply to file wildcards in Win32
use Win32::Process; print "Enter the subdirectory you'd like to parse: "; $path = <STDIN>; chomp( $path ); $prefix = "C:\\Projects\\Source\\"; $path = "$prefix$path"; $path = "." unless $path; opendir( DIR, $path ) or die "Can't open $path: $!"; while ( $entry = readdir( DIR ) ) { $type = ( -d "$path\\$entry" ) ? "dir" : "file"; # $path is crucia +l! if( $entry =~ /\.h|\.c$/ ){ print "$entry\n"; } } closedir( DIR );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: RE: file wildcards in Win32
by flyfishin (Monk) on Jun 17, 2000 at 00:08 UTC |