【发布时间】:2010-11-26 14:37:20
【问题描述】:
我必须改变什么才能使它工作?
#!/usr/bin/perl
use 5.012;
use warnings;
require "/usr/lib/perl5/vendor_perl/5.12.1/x86_64-linux-thread-multi/sys/ioctl.ph";
my ($rows, $cols, $xpix, $ypix);
my $winsize = "\0" x 8;
my $TIOCGWINSZ = 0x40087468; # should be require sys/ioctl.pl
if (ioctl(STDOUT, $TIOCGWINSZ, $winsize)) {
($rows, $cols, $xpix, $ypix) = unpack('S4', $winsize);
} else {
say "something didn't work" and exit;
}
【问题讨论】:
-
你真的有一个正确安装了
sys/ioctl.ph的系统吗?哪一个?