codeKnight has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl #Script to create required directories in user provided location argum +ent. my $Dir = $ARGV[0]; if(! -e "$Dir") { print "Please try again with a valid directory.\n"; exit 1; } elsif(! -d "$Dir") { print "Please try again with a valid directory.\n"; exit 1; } elsif(($#ARGV+1) < 1) { print "Please try again with a valid directory.\n"; exit 1; } #Change to user selected location chdir($Dir);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help with exercise
by Laurent_R (Canon) on Sep 23, 2017 at 09:02 UTC | |
by NetWallah (Canon) on Sep 23, 2017 at 17:21 UTC | |
by Random_Walk (Prior) on Sep 24, 2017 at 07:40 UTC | |
by Laurent_R (Canon) on Sep 24, 2017 at 07:47 UTC | |
by karlgoethebier (Abbot) on Sep 24, 2017 at 16:11 UTC | |
|
Re: Help with exercise
by Anonymous Monk on Sep 23, 2017 at 04:21 UTC | |
|
Re: Help with exercise
by Anonymous Monk on Sep 23, 2017 at 00:02 UTC | |
by codeKnight (Initiate) on Sep 23, 2017 at 00:14 UTC | |
by huck (Prior) on Sep 23, 2017 at 01:03 UTC | |
by codeKnight (Initiate) on Sep 23, 2017 at 01:19 UTC | |
by Anonymous Monk on Sep 23, 2017 at 03:38 UTC |