Jeff Westman wrote:
> print "Executing 'date'\n";
> @result = $t->cmd("date");
> foreach (@result) {
> print;
> }
> $t->close && print "Connection closed\n";
> <---------------------------------------->
> So.......... what's with the '(' in $result[1] ??? I know I can filter this
> out ... but WHY is this happening? (happens with EVERY command I send to
> Net::Telnet)
Is that true regardless of the OS or shell you log into? Have you tried using single
quotes instead of double. The code looks alright to me, but
1) It assumes that a list is returned by the remote system. Are you sure the command
on the remote system returns a list?
2) I am sort of wondering whether the system might not be interpolating the date as
the Perl date function. Unlikely though, as this would be more likely to return an
error from the remote system. In any case, it might be better to try a string literal
using single quotes.
3) Another wild guess--try losing the parentheses around 'date'. I don't know if this
will help, but this from perldoc:
[
This method sends the command *$string*, and reads the characters
sent back by the command *up_until_and_including_the_matching_prompt.* #emphasis mine
It's assumed that the program to which you're sending is some kind
of command prompting interpreter such as a shell.
]
I am sort of curious as to what is causing this, too.
Joseph
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]