由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - how to write robort in perl w/out expect?
相关主题
[转载] Perl calls PL/SQL funtions[转载] 求助:用不了telnet了,XP系统。
why?FTP Help
System Environment variables in PerlIs there any software can D/L a whole directory?
求助: DHCP设置on solarisA simple question!
怎么合法设置hostname?[转载] 问一个问题
How to understand 'global zone' in solaris?gcc in mac OSX
Korn shell scripthow to find teh net connection info in UNIX?
How to edit @INC array for perl? How do i get a list of all computers?
相关话题的讨论汇总
话题: expect话题: robort话题: net话题: perl话题: out
进入Unix版参与讨论
1 (共1页)
a***a
发帖数: 62
1
w/out expect, how to write a robort?
such as login to a server, such as this bbs site?
h**h
发帖数: 132
2
use Net::Telnet

【在 a***a 的大作中提到】
: w/out expect, how to write a robort?
: such as login to a server, such as this bbs site?

a***a
发帖数: 62
3
can you give me a simple example?
following is mine:
*******************************************
#!/pkg/gnu/bin/perl
use Net::Telnet ();
use Net::Ping ();
use strict qw($mode);
$host = "hostname";
$t = new Net::Telnet (Timeout => 15);
$mode = sub { print "Now we step on to next host.\n";
next;
};
print "Now we try out host: $host\n";
$t->open($host);
$t->waitfor(Match => '/login[: ]*$/i',
Match => '/username[: ]*$/i');
$t->print("myusername");
$t->waitfor(Match

【在 h**h 的大作中提到】
: use Net::Telnet
h**h
发帖数: 132
4
the problem is that you don't have Net::Telnet module installed
you can download it from cpan
Also it comes with a 20 pages manual, you can convert it into ps format
and have a nice print out format.
usually it is installed in site.... directory, instead
of standard lib
h**h
发帖数: 132
5
btw, did you try expect lib in C?
there is a chapter in Exporing Expect, introducing
how to embedded expect funtion into C

【在 h**h 的大作中提到】
: the problem is that you don't have Net::Telnet module installed
: you can download it from cpan
: Also it comes with a 20 pages manual, you can convert it into ps format
: and have a nice print out format.
: usually it is installed in site.... directory, instead
: of standard lib

a***a
发帖数: 62
6
no, i can't install expect ah,
to install it, i should have root permit. I am in unix,
not linux.

【在 h**h 的大作中提到】
: btw, did you try expect lib in C?
: there is a chapter in Exporing Expect, introducing
: how to embedded expect funtion into C

a***a
发帖数: 62
7
ok, Now i install that in my private directory, such as
~/lib/perl/Net/Telnet.pm
and change the PATH env include that
but it still say can't locate it, it only search in
/pkg/perl..... not my directory, do u know what's wrong?

【在 h**h 的大作中提到】
: the problem is that you don't have Net::Telnet module installed
: you can download it from cpan
: Also it comes with a 20 pages manual, you can convert it into ps format
: and have a nice print out format.
: usually it is installed in site.... directory, instead
: of standard lib

a***a
发帖数: 62
8
i got it in this way,
go to ~/lib/perl/ to run my program, stupid way.

【在 a***a 的大作中提到】
: ok, Now i install that in my private directory, such as
: ~/lib/perl/Net/Telnet.pm
: and change the PATH env include that
: but it still say can't locate it, it only search in
: /pkg/perl..... not my directory, do u know what's wrong?

1 (共1页)
进入Unix版参与讨论
相关主题
How do i get a list of all computers?怎么合法设置hostname?
bash prompt 一问How to understand 'global zone' in solaris?
Re: help me! Re: how to configure networking after installationKorn shell script
Shell Script Question about HostnameHow to edit @INC array for perl?
[转载] Perl calls PL/SQL funtions[转载] 求助:用不了telnet了,XP系统。
why?FTP Help
System Environment variables in PerlIs there any software can D/L a whole directory?
求助: DHCP设置on solarisA simple question!
相关话题的讨论汇总
话题: expect话题: robort话题: net话题: perl话题: out