Server IP : 184.154.167.98 / Your IP : 3.142.55.62 Web Server : Apache System : Linux pink.dnsnetservice.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64 User : puertode ( 1767) PHP Version : 8.2.26 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/doc/perl-Expect/examples/ |
Upload File : |
use strict; use warnings; use Expect; my $e = Expect->new; $e->spawn($^X, "examples/calc.pl") or die; $e->log_stdout(0); $e->raw_pty(1); $e->send("19+23\n"); $e->expect(1, "19+23"); print 'Match: <', $e->match, ">\n"; print 'Before: <', $e->before, ">\n"; print 'After: <', $e->after, ">\n"; $e->clear_accum; $e->expect(1, '-re' => qr/'\d+'/); print 'Match: <', $e->match, ">\n"; print 'Before: <', $e->before, ">\n"; print 'After: <', $e->after, ">\n"; $e->close;