| Author |
Re: Environment variable evaluation in a conditional
|
|
| useperl-jeff@yahoo.com.cn 2007-09-20, 7:59 am |
|
--- smdspamcatcher@hotmail.com wrote:
> I am currently trying to write a Perl program in a Solaris 9
> environment
> I am trying to process a list of variables with UNIX environment
> variables embedded in them of the form
> $dir_to_check = "$ENV_VAR1/some_dir/$ENV_VAR2/another_dir";
> and I am trying to find if another_dir exists, so I have a line of
> code that tries to do something like this:
>
> if (-e $dir_to_check) { do some stuff }
>
Hi,
It's `-d dir` for directory exist test.
`-e` is for file exist test.
________________________________________
________________________________________
____ Get the World's number 1 free email service.
http://mail.yahoo.com.au
| |
| Rob Dixon 2007-09-20, 7:59 am |
| useperl-jeff@yahoo.com.cn wrote:
> --- smdspamcatcher@hotmail.com wrote:
>
>
> It's `-d dir` for directory exist test.
> `-e` is for file exist test.
Not really. It's
-e for item exists
-d for item exists and is a directory
-f for item exists and is a plain file
Rob
| |
| useperl-jeff@yahoo.com.cn 2007-09-20, 7:59 am |
|
--- Rob Dixon <rob.dixon@350.com> wrote:
>
> Not really. It's
>
> -e for item exists
> -d for item exists and is a directory
> -f for item exists and is a plain file
>
Sorry,my mistake.You're right.
________________________________________
________________________________________
____
Sick of deleting your inbox? Yahoo!7 Mail has free unlimited storage.
http://au.docs.yahoo.com/mail/unlimitedstorage.html
|
|
|
|