Shawn H Corey <shawnhco...@gmail.com> writes:

> On Tue, 27 Jan 2015 09:37:15 -0500
> Harry Putnam <rea...@newsguy.com> wrote:
>
>> #!/usr/local/src/test/bin/perl
>> 
>> use strict;
>> use warnings;
>> use Cwd 'abs_path';
>> 
>> my $tdir = shift;
>> 
>
> You can use `-e` to determine if the path exists and `-d` to determine
> if it's a directory. See `perldoc -f -X` and search for /-e/ and /-d/,
> http://perldoc.perl.org/functions/-X.html

Thanks, yes.. I knew about -d but was looking to get there in one
move....

>From OP:
"In the following code I hoped to use `use Cwd abs_path;' to not
only produce the absolute path for a  named directory but to die if it
could not... thereby getting around having to test the named dir with
-d ... to make sure it was really a directory in the fs."

Note the comment after `not...'

So, just thought, why not skip a step.

But I see the sense in the discussion brought by Brandon M. 


-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to