Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Perl don't seem to be able to find my module
July 28, 2015, 3:00 am
rate this thread
Perl does not seem to be able to find a module
that instmodsh does show being there:
Available commands are:
Installed modules are:
This line (5)
triggers this response:
Can't locate Term/ReadKey/GetTerminalSize.pm in @INC (@INC
contains: /usr/local/lib64/perl5 /usr/local/share/perl5
/usr/lib64/perl5 /usr/share/perl5 .) at ./ScreenSize.pl
Searching for the guys give me:
# find /usr -iname \*ReadKey\*
So it is indeed there.
Now what am I doing wrong?
Re: Perl don't seem to be able to find my module
When you say "use Term::ReadKey::GetTerminalSize;"
then perl goes around looking for a module by the name of GetTerminalSize.pm
in the /Term/ReadKey/ directories.
What you really need is ReadKey.pm module in which GetTerminalSize() is a func.
So modify the use statement to
use Term::ReadKey; # import all symbols in @EXPORT of ReadKey.pm
use Term::ReadKey qw( GetTerminalSize ); # import only GetTerminalSize
- » How to get the height and width of a string by perl
- — Previous thread in » PERL Discussions