use Modern::Perl; use utf8; use telnet; async purge_cdata => sub { my $ip = shift; my $login = shift; my $password = shift; my $tree = shift; my $t = new telnet($ip); $t->debug(1); await $t->connect; await $t->reply(qr/User name:/, $login); await $t->reply(qr/User password:/, $password); $t->print("enable"); await $t->waitfor("#"); $t->prompt(qr/#\s?$/); await $t->cmd("config"); await $t->cmd("vty output show-all"); $t->print("Interface epon 0/$tree"); my @lines = await $t->cmd("show ont info $tree all"); say Dumper @lines; $t->close; return 5; }; 1;