[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Odd StandardFile behavior



Hey all-

The following snippet works great- except when you select a drive as your
root directory. The leading : returned by the GetFolder call seems to mess
up the -e test. Is this a -e problem or a StandardFile problem? (I'm using
the 510b1r2 version).

Also, would anyone like to help rewrite StandardFile.pl so it runs cleanly
under -w?


Tim


#!/usr/bin/perl
use File::Find;
use Carp;
require "StandardFile.pl";
$start_folder = &StandardFile::GetFolder("Tell me where to start.");
find(\&is_it_there, $start_folder);#walks the tree, calling the file parser
on each file as it goes by.


sub is_it_there
{
print "Looking for $File::Find::name.\n";
 if (-e $File::Find::name) {print "Found $File::Find::name\n";}
 else {croak "Can't find $File::Find::name!\n";}
}

----------------=============================----------------
Tim Howland                               VSI
New Media Director           44 N Main, Norwalk, CT 06854
(203) 852-1010, ex. 248             F:(203) 831-5116
thowland@vsicom.com               http://www.vsicom.com