It's a conspiracy!

djberg96 on 2003-04-29T00:56:19

I have gotten a bunch of bug reports in the last couple of weeks regarding Net::SCP::Expect, and today I got a doozy. One user reports that the only way he could get it to work properly was to remove the newline in:

$scp->send("$password\n");

Quite frankly, I don't understand how it could work *without* a newline. In addition, I've hit some kind of weird bug while attempting to connect to a FreeBSD system. I connect, the password is sent, and yet....it sits there, still waiting for the password. Works fine on the other systems I've tested. Very strange. Oh, and I still don't know why copying large files works for some people and not for others. One use has reported that copying large files works as root, but not as a normal user.

Sigh. Well, this was only meant to be a standin module until a "real" scp module was written, but that hasn't materialized. I was almost ready to release, too. I'm debating whether or not to just put some of these things in a "known but inexplicable bugs" section and just release anyway.


\n or \r?

jdavidb on 2003-04-29T14:14:50

In TCL Expect, I always had to use \r. I've still never mastered exactly when you have to do that for Expect.pm, and when you can get away with \n. Could it vary from system to system? What does the user get when he tries \r? Do we even know when we can use each and why?

I'm debating whether or not to just put some of these things in a "known but inexplicable bugs" section and just release anyway.

Do it. Standard manpages don't have a BUGS section for nothing, you know. You can fix them later, if you feel like it. There's no rule that says a release is bugless.

Re:\n or \r?

djberg96 on 2003-04-29T15:38:39

In that case, I think I'll add a "terminator" option, which will default to "\n", but which the users can set to "\r" or "undef" (or whatever), as they prefer. It'll just have to be up to folks to figure out which one to use.

Everything else works for me, including large files and globbing. I'm also debating whether to require 5.6, but I'm worried I'll piss too many people off. I wish I had done it from the start.

Re:\n or \r?

pudge on 2003-04-30T14:21:50

Maybe the user set $\, which might output \n automatically if you are using print, and maybe two \n's were being sent ...

Re:\n or \r?

djberg96 on 2003-04-30T19:03:58

Worth checking, but I don't think so. The user explicitly said that removing the newline from the $scp->send call fixed the problem.

Re:\n or \r?

pudge on 2003-05-01T00:53:58

Right. If a newline is necessary, then including a newline with $\ = "\n" would send two newlines, and including no newline would send a single newline, since Expect->send uses print.

Re:\n or \r?

djberg96 on 2003-05-01T03:37:02

Oops - you're right. I spaced. Well, jdavidb's comment still warrants a "terminator" option I think, since I wasn't aware that a "\r" might be used.

Re:\n or \r?

jdavidb on 2003-05-01T20:38:00

I think the terminator to use depends on whether the terminal is in raw or cooked mode, so you might be able to check the mode and decide as appropriate. I think cooked mode translates \r to \n. I think I heard that \n should "always" work, for some value of always sufficiently less than or equal to 100%. :)

But I really don't know.

Re:\n or \r?

jdavidb on 2003-05-01T20:40:28

Standard manpages don't have a BUGS section for nothing, you know.

Oh, and while you're at it, that's why they have SKIP tests in Test::More. :)