English 中文(简体)
帮助Perl Expect
原标题:Help with Perl Expect
  • 时间:2011-04-22 06:03:11
  •  标签:
  • perl
  • expect

我是Perl方案规划的新手。 目前,我的任务是了解一些法典。

我必须理解《佩雷特特法》,在这项法典中,下面提到一条线:

我的美元价=新价;

预支费用

我的理解是,第1行表明,我们树立了阶级和第二行的榜样,建立了儿童进程。

如果有人对我作更明确的解释,我将向他们表示真正感谢。

问题回答

首先,请允许我帮助你:

  • For help with Perl check the perldoc.
  • For help with Perl modules, check CPAN.

你正在与Expect模块合作,见http://search.cpan.org/~rgiersig/Expect-1.15/Expect.pod” rel=“nofollow”>CPAN:Expect。

从严格意义上来说,你们都在采取两种方法:

my $exp = Expect->new(); #Yes, the new Expect is a shorthand version
$exp->spawn("su");

这两种方法都在阿根廷国家空间局上记录,它们的确是do, 你是expect(没有用纸)做的:第一个方法制造了外来物体,第二个方法在没有任何参数的情况下产生了“超级”程序。

现在,你或许可以采用发送方式,并期望用各种方法向这一进程发出指示,或等到要求投入为止。 CPAN的例子:

# send some string there:
$exp->send("string
");

# then do some pattern matching with either the simple interface
$patidx = $exp->expect($timeout, @match_patterns);




相关问题
Why does my chdir to a filehandle not work in Perl?

When I try a "chdir" with a filehandle as argument, "chdir" returns 0 and a pwd returns still the same directory. Should that be so? I tried this, because in the documentation to chdir I found: "...

How do I use GetOptions to get the default argument?

I ve read the doc for GetOptions but I can t seem to find what I need... (maybe I am blind) What I want to do is to parse command line like this myperlscript.pl -mode [sth] [inputfile] I can use ...

Object-Oriented Perl constructor syntax and named parameters

I m a little confused about what is going on in Perl constructors. I found these two examples perldoc perlbot. package Foo; #In Perl, the constructor is just a subroutine called new. sub new { #I ...

Where can I find object-oriented Perl tutorials? [closed]

A Google search yields a number of results - but which ones are the best? The Perl site appears to contain two - perlboot and perltoot. I m reading these now, but what else is out there? Note: I ve ...

热门标签