Or you can add 26. my $dir = $_[0]; >
die qq{ Please pass the directory name...} if (! -d "$dir");# Test whether you are getting actual directory > 27. if ($dir =~ m/^d/){ > 28. $ftp->cwd("$dir") or die "Error" > 29. ..... (This location is my problem ) > 30. } > Thanks, Chandrashekar On Tue, Nov 9, 2010 at 7:55 AM, Thomas Brightbill <tho...@brightbill.net>wrote: > On 11/4/2010 1:36 AM, sync wrote: > > 26. my $dir = $_[0]; >> 27. if ($dir =~ m/^d/){ >> 28. $ftp->cwd("$dir") or die "Error" >> 29. ..... (This location is my problem ) >> 30. } >> > > I suspect that $dir contains a string that starts with the directory > attributes (eg "dwrxwrxwrc"), has some other data, and ends with the > directory name. You probably want to pass just the directory name so you'll > probably need to split out the directory name portion of $dir and pass that > to cwd. > > (you can check this by adding something like > > print "\$dir is $dir\n"; > > between lines 27 and 28) > > Hope that helps, > > Thomas > > -- > Thomas Brightbill > tho...@brightbill.net > http://www.brightbill.net > > > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h...@perl.org > http://learn.perl.org/ > > >