'perl module not found: still missing a file Telnet.pm after adding it to the path

I'm getting the following error while trying to conect via

use FileHandle;
use IPC::Open2;

$p=open2(\*R,\*W,"cr");

$username = "m";  # your login HERE
$passwd = "s"; # your PASSWORD here
use Net::Telnet ();
$telnet = new Net::Telnet (Timeout => 4000,
                         Prompt => '/c% /',
                         Port => 2000 );

I have created the directory Net/Telnet.pm in my @INC but it didn't helped. What should I fix yet ?

$ perl tm8.pl
Can't locate Net/Telnet.pm in @INC (you may need to install the Net::Telnet module) (@INC contains: /usr/local/lib/perl5/site_perl/5.30/x86_64-cygwin-threads /usr/local/share/perl5/site_perl/5.30 /usr/lib/perl5/vendor_perl/5.30/x86_64-cygwin-threads /usr/share/perl5/vendor_perl/5.30 /usr/lib/perl5/5.30/x86_64-cygwin-threads /usr/share/perl5/5.30) at tm8.pl line 8.
BEGIN failed--compilation aborted at tm8.pl line 8.


Solution 1:[1]

I will assume that you already try install the Net::Telnet with cpanm Net::Telnet or

perl -MCPAN -e shell
install Net::Telnet

I suggest for you try install the Net::Telnet with sudo command:

sudo perl -MCPAN -e shell
install Net::Telnet

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Guilherme Giácomo Simoes