[Wellington-pm] File tests
Martyn Smith
martyn at catalyst.net.nz
Mon Nov 3 02:05:50 PST 2008
Hmm, it certainly seems to work for me :-) (i.e. the -e test returns true
for a valid link).
Are you sure the link Y/ZZ isn't pointing to a file that doesn't exist?
(i.e. are you sure it's not a broken symlink?)
On Mon, Nov 03, 2008 at 10:47:47PM +1300, Cliff Pratt wrote:
>
> If $dir = Y is a directory and exists then the following snippet prints
> nothing (as desired and expected). If $dir = Y/ZZ exists and is a link
> I get 'File or directory "Y/ZZ" does not exist'. I'd rather it prints
> nothing.
>
> Obviously I'm missing something. But what?
>
> Cheers,
>
> Cliff
>
> if ( ! -e "$dir" )
> {
> $self->{error_msg} = "File or directory \"$dir\" does not exist." ;
> $self->{error} = 'true' ;
> print "$self->{error_msg}\n" ;
> return 1 ;
> }
> _______________________________________________
> Wellington-pm mailing list
> Wellington-pm at pm.org
> http://mail.pm.org/mailman/listinfo/wellington-pm
>
More information about the Wellington-pm
mailing list