Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using network paths

Status
Not open for further replies.

riverrunner6

Programmer
Jan 7, 2009
1
US
Definate newbie to Perl and programming. I am attempting to script out a routine to search a file tree for a specific file. The code below works great on my local hard drive to produce a list of files but how do I work produce this list from a network drive?

Code:
#!/usr/bin/perl
use strict;
use warnings;

$Bentley = 'N:\building\'
@files = $Bentley<*.dgn>);
foreach $file (@files) {
print $file . "\n";
}
I am not doing this right using the array, any suggestions would be very helpful

D
 
I would look into using File::Find::name. You recursively searches path/dirs. You can also add a regex to only look for certain names, files extensions....Kinda like find on steroids.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top