Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help

Status
Not open for further replies.

rudorathod

IS-IT--Management
Jun 4, 2007
11
0
0
US
I have the following part of code in perl
and i am trying to figure out what is wrong and why it fails.

I am running the following command

/usr/loc/bin/shift -v --md5 --record=shift --append-date --no-open=w ~account/ ~/account>> ~/account/shift.log 2>&1
___________________________________________________________

#!/usr/bin/perl

use strict qw(vars);
use Cwd qw(mod_path);

my $src = mod_path(shift(@ARGV) || $ENV{HOME});

die "Directory does not exist: $src" unless -d $src;

___________________________________________________________

so when i look at the shift.log file
it says

"Directory does not exist "

can someone suggest whats wrong
 
what is the value of $src in the perl code? -d will only work in the current directory or with the full path to the directory if not in the current directory.

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
You don't seem to be processing the options beforehand.
So when you shift @ARGV, you get '-v' which (probably) isn't a directory.

BTW, what is mod_path()? I can only see abs_path(), realpath() and fast_abs_path() in the Cwd module.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top