On Wed November 5 2003 07:28, Tfbsr Bertrand wrote:
> I have this bit of code in a cgi script and cannot seems to get it it work.
>  Is there any problem in calling the opendir command from a cgi script?
>
> It always comes back with cannot opendir directory.
> If I give it a local path instead of remote path, it open but prints
> nothing. Any ideas
> Thanks in advance
>
> $CUR_DIR = "\\\\myserver\\e\$\\dir1\\dir2
>
> opendir(HOMEDIR, $CUS_DIR) || die "can't open customers home directory:$!";
> while(defined ($file = readdir(HOMEDIR))) {
>  next if $file =~ /^\.\.?$/;
>  next if -f $file;
>  print "$file\n";
> }

well, since $CUS_DIR is undefined (assumedly), perl shouldn't be able to open 
it.
maybe you want it to be $CUR_DIR instead?
also, without any variable, you don't need to double quote your path.
"\\\\myserver\\e\$\\dir1\\dir2" == '\\myserver\e$\dir1\dir2'

HTH
Adam

-- 
-bash: cd: /dev/mouse: No such file or directory. Should I `killall -5 cat` ? 
(y or n)

_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to