0

I'd like to have all the installed CPAN modules updated automatically every night, so I've placed the following command in the crontab:

@daily cpan -i $(cpanp -o | perl -lane 'print $F[3]')

However, whenever this is run I get the following error message:

Unable to get Terminal Size. The TIOCGWINSZ ioctl didn't work. The COLUMNS and
LINES environment variables didn't work. The resize program didn't work. at
/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/Term/ReadKey.pm
line 362.
Compilation failed in require at /usr/lib/perl5/site_perl/5.8.8/Term/ReadLine
/Perl.pm line 63.

What can I do to get this working?

brian d foy
  • 129,424
  • 31
  • 207
  • 592
Kiffin
  • 1,048
  • 1
  • 15
  • 21

3 Answers3

3

Come back on Monday. I'll add a -u command to cpan to do that if you promise to test it for me. You'll have to get the latest cpan from App::Cpan.

Okay, don't wait until Monday. I've pushed the change to the cpan-script Github repo, and App-Cpan 1.56_15 is on its way to CPAN.

Let me know if you have any problems or the new feature doesn't do what you want.

brian d foy
  • 129,424
  • 31
  • 207
  • 592
  • So to install this I only need to download http://search.cpan.org/CPAN/authors/id/B/BD/BDFOY/App-Cpan-1.56_15.tar.gz and do the usual perl Makefile.PL etc. thing? – Kiffin Nov 14 '09 at 11:46
2

Please use brian d foy's answer as he added a cpan option to do this

Are you trying to update the list of modules with CPAN or actually update any out of date modules (d/l, compile, install)? This could be dangerous as modules could change interface and existing scripts would fail. This error is due to CPAN trying to use Term::ReadLine and Term::ReadKey to interrogate the terminal.

If you really want to upgrade all your modules, you can use this command:

perl -MCPAN -e 'CPAN::Shell->install(CPAN::Shell->r)'

This is a small change from the command given in the documentation to interrogate CPAN for all outdated modules:

https://metacpan.org/pod/CPAN#PROGRAMMERS-INTERFACE

szabgab
  • 6,202
  • 11
  • 50
  • 64
Wayne Arthurton
  • 643
  • 1
  • 6
  • 22
0

The COLUMNS and LINES environment variables didn't work.

Try setting the COLUMNS and LINES environment variables.

COLUMNS=80
LINES=24
@daily cpan -i $(cpanp -o | perl -lane 'print $F[3]')
a paid nerd
  • 30,702
  • 30
  • 134
  • 179