S
S
script882012-07-10 15:56:00
Perl
script88, 2012-07-10 15:56:00

Curses in Perl throws errors

I'm trying to figure out an example

#!/usr/bin/perl -w

use Curses::UI;
    my $cui = new Curses::UI;
    my $win = $cui->add('window_id', 'Window');
    my $listbox = $win->add(
        'mylistbox', 'Listbox',
        -values    => [1, 2, 3],
        -labels    => { 1 => 'One',
                        2 => 'Two',
                        3 => 'Three' },
        -radio     => 1,
    );

    $listbox->focus();
    my $selected = $listbox->get();


crashes on startup

[[email protected] BRmysql]# perl Curses.pl
Can't locate Curses/UI.pm 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 Curses.pl line 3.
BEGIN failed--compilation aborted at Curses.pl line 3.


perl-Curses.x86_64 - installed

OS CentOS release 6.3 (Final) x86_64

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
V
Vyacheslav Golovanov, 2012-07-10
@script88

You can just try
perl -MCPAN -e 'install Curses::UI'

K
kafeman, 2012-07-10
@kafeman

  1. Search UI.pmin the indicated directories ( /usr/local/lib64/perl5, /usr/local/share/perl5, /usr/lib64/perl5/vendor_perl, /usr/share/perl5/vendor_perl, /usr/lib64/perl5, /usr/share/perl5).
    If you don't find it, it means it wasn't installed or installed in the wrong place (then add the path to INC ).
  2. If the file is found, check its read permissions - I recently had the same error due to the program not being able to read the package.

K
kafeman, 2012-07-10
@kafeman

  1. Search UI.pmin the indicated directories ( /usr/local/lib64/perl5, /usr/local/share/perl5, /usr/lib64/perl5/vendor_perl, /usr/share/perl5/vendor_perl, /usr/lib64/perl5, /usr/share/perl5).
    If you don't find it, it means it wasn't installed or installed in the wrong place (then add the path to INC ).
  2. If the file is found, check its read permissions - I recently had the same error due to the program not being able to read the package.

K
kafeman, 2012-07-10
@kafeman

  1. Search UI.pmin the indicated directories ( /usr/local/lib64/perl5, /usr/local/share/perl5, /usr/lib64/perl5/vendor_perl, /usr/share/perl5/vendor_perl, /usr/lib64/perl5, /usr/share/perl5).
    If you don't find it, it means it wasn't installed or installed in the wrong place (then add the path to INC ).
  2. If the file is found, check its read permissions - I recently had the same error due to the program not being able to read the package.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question