Perl don't seem to be able to find my module

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi All,

Perl does not seem to be able to find a module
that instmodsh does show being there:

      $ instmodsh

      Available commands are:
         cmd? l
         Installed modules are:

This line (5)
     use Term::ReadKey::GetTerminalSize;

triggers this response:
     Can't locate Term/ReadKey/ in @INC (@INC
     contains: /usr/local/lib64/perl5 /usr/local/share/perl5
     /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl
     /usr/lib64/perl5 /usr/share/perl5 .) at ./
     line 5.

Searching for the guys give me:
     # find /usr -iname \*ReadKey\*

So it is indeed there.

Now what am I doing wrong?

Many thanks,

Re: Perl don't seem to be able to find my module

On Tuesday, 28 July 2015 08:30:45 UTC+5:30, T  wrote:

Quoted text here. Click to load it

When you say "use Term::ReadKey::GetTerminalSize;"
then perl goes around looking for a module by the name of
in the /Term/ReadKey/  directories.

What you really need is module in which GetTerminalSize() is a func.

So modify the use statement to
     use Term::ReadKey; # import all symbols in @EXPORT of
     use Term::ReadKey qw( GetTerminalSize ); # import only GetTerminalSize

Site Timeline