Thanks guys. Your suggestions made me realize that I couldn't perform the -f
test on $FileName without telling perl how to find it. I assumed that
$FileName automatically included the path, but now realize it only holds the
file name. (Gee, you'd think the variable name "$FileName" might have tipped
me off to that). 

So, instead of this:
if (-f $FileName) { ...do updates..... }

I now have this:
$specfile = $directory_path . ':' . $directory_name . ':' . $FileName;
if (-f $specfile) { ...do updates..... }

It seems to work fine.

Thanks for helping a novice.

Carl.

> From: John Delacour <[EMAIL PROTECTED]>
> Date: Sat, 10 Apr 2004 08:50:53 +0100
> To: Carl Miller <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
> Subject: Re: [MacPerl] problem with f- test in macperl
> 
> 
> At 10:03 pm -0400 9/4/04, Carl Miller wrote:
> 
>> if (-f $FileName) {
>> 
>> 
>> For some reason, this doesn't work.
> 
> 
> Does this work ?:
> 
> my $file = "$ENV{MACPERL}README";
> open F, $file or die $!;
> -f $file and print "\aFile is a plain file\n"
> 
> It does here.
> 
> Are you sure you have the paths right?
> 
> JD
> 

Reply via email to