Subject: | carp used but Carp module not loaded |
Date: | Sat, 13 Dec 2008 21:31:59 +0100 |
To: | bug-Net-Telnet-Options [...] rt.cpan.org |
From: | "Matthieu Clavier" <mat.clavier [...] gmail.com> |
Hi,
i've found a little bug in Net::Telnet::Options,
but it's totaly harmless in my case.
Net::Telnet::Options - 0.0.1
installed from CPAN
$ perl -v
This is perl, v5.8.8 built for i386-linux-thread-multi
Copyright 1987-2006, Larry Wall
[ ... ]
$ uname -a
Linux mo 2.6.23.1-42.fc8 #1 SMP Tue Oct 30 13:55:12 EDT 2007 i686 i686
i386 GNU/Linux
$ cat /etc/fedora-release
Fedora release 8 (Werewolf)
carp is used in Net::Telnet::Options:
$ grep carp Net/Telnet/Options.pm
carp("Already asking $opt.\n");
carp("We're not wanting that anyway!\n");
carp("Already wanting $opt.\n");
carp("We're not wanting that anyway!\n");
carp("Option $opt not turned on!\n");
But Carp module is never loaded !
maybe i'm using Net::Telnet:Options the wrong way,
cf. http://www.perlmonks.org/index.pl?node_id=567581
eval {
my %options = (TTYPE => { 'DO' => sub {} },);
my $nto = Net::Telnet::Options->new(%options);
my $data = undef;
my $telnet = Net::Telnet->new(
timeout => 5,
Prompt => '/.+sumo.+>\s+$/'
) or die $!;
$telnet->open(
$parameters->{'host'}
) or die $!;
recv($telnet, $data, 1024, 0);
$nto->answerTelnetOpts($telnet, $data);
$nto->sendOpt($telnet, 'SB', 24, 'IS', 'xterm');
recv($telnet, $data, 1024, 0);
$nto->answerTelnetOpts($telnet, $data);
recv($telnet, $data, 1024, 0);
$nto->answerTelnetOpts($telnet, $data);
$telnet->login(
$parameters->{'username'},
$parameters->{'password'}
) or die $!;
@lines = $telnet->cmd( $parameters->{'commande'} ) or die $!;
$telnet->close() or die $!;
};
Best regards
--
Matthieu Clavier