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


> $tdir = abs_path($tdir)  or die "Can't find  <$tdir>: $!";
> 
> chdir $tdir or die "Can't chdir <$tdir>: $!";
> 
> print "Hello from $tdir\n";


-- 
Don't stop where the ink does.
        Shawn

-- 
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