不是GLOB参考在... IO / Select.pm行61 [英] Not a GLOB reference at ...IO/Select.pm line 61

查看:644
本文介绍了不是GLOB参考在... IO / Select.pm行61的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在传递一个 IO ::选择对象作为 IO :: Select :: add 以下错误:

I am passing an IO::Select object as handle to IO::Select::add and getting the following error:

Not a GLOB reference at ...IO/Select.pm line 61

这个工作已经有好几年了,从几天(周)开始,人们开始收到错误。在线上看,我无法确定是否以错误的方式使用电话,或者如果某些最近的perl或 DNS :: Resolver 更新可能是问题的原因

This worked for years and since a couple of days (weeks) people are beginning to get the error. Looking online I was not able to find out if I was using the call in the wrong way or if some recent perl or DNS::Resolver update could be the cause of the problem.

我正在做以下

#!/usr/bin/perl

use IO::Select;
use Net::DNS;

# create a resolver object
my $res = Net::DNS::Resolver->new();

# create an IO::Select object
my $sel = IO::Select->new();


# perform the background DNS query
my $sock = $res->bgsend('corti.li');

# adding the socket generates the error
$sel->add($sock);

添加一些调试我没有看到任何错误:

Adding some debugging I don't see anything wrong:

#!/usr/bin/perl

use Data::Dumper;
use IO::Select;
use Net::DNS;

# create a resolver object
my $res = Net::DNS::Resolver->new();

warn Dumper $res;

# create an IO::Select object
my $sel = IO::Select->new();

warn Dumper $sel;

# perform the background DNS query
my $sock = $res->bgsend('corti.li');

warn Dumper $sock;

# adding the socket generates the error
$sel->add($sock);

生成

$VAR1 = bless( {
                 'force_v4' => 0,
                 'retrans' => 5,
                 'persistent_udp' => 0,
                 'adflag' => 0,
                 'force_v6' => 0,
                 'port' => 53,
                 'answerfrom' => '',
                 'prefer_v6' => 0,
                 'defnames' => 1,
                 'tcp_timeout' => 120,
                 'udp_timeout' => 30,
                 'igntc' => 0,
                 'udppacketsize' => 0,
                 'dnsrch' => 1,
                 'recurse' => 1,
                 'srcaddr' => 0,
                 'persistent_tcp' => 0,
                 'retry' => 4,
                 'cdflag' => 0,
                 'nameserver4' => [
                                    '129.132.98.12'
                                  ],
                 'searchlist' => [
                                   'd.ethz.ch',
                                   'ethz.ch'
                                 ],
                 'tsig_rr' => undef,
                 'nameserver6' => [
                                    '2001:67c:10ec::c'
                                  ],
                 'usevc' => 0,
                 'dnssec' => 0,
                 'debug' => 0,
                 'errorstring' => 'unknown error or no error',
                 'srcport' => 0
               }, 'Net::DNS::Resolver' );
$VAR1 = bless( [
                 undef,
                 0
               ], 'IO::Select' );
$VAR1 = bless( [
                 ',
                 1,
                 undef,
                 undef,
                 undef,
                 [
                   bless( \*Symbol::GEN0, 'IO::Socket::IP' ),
                   1448125508,
                   '129.132.98.12',
                   54103
                 ]
               ], 'IO::Select' );
Not a GLOB reference at /Users/corti/perl5/perlbrew/perls/perl-5.22.0/lib/5.22.0/darwin-2level/IO/Select.pm line 61.

我使用的是Perl 5.22和Net :: DNS 1.03

I am using Perl 5.22 and Net::DNS 1.03

使用Perl 5.18和Net :: DNS 0.74代码工作。

Using Perl 5.18 and Net::DNS 0.74 the code works.

我做错了什么,还是一个错误?

Am I doing something wrong or it is a bug?

推荐答案

该问题是由于Net :: DNS :: Resolver bgsend API的更改引起的

The problem is caused by a change in the API of Net::DNS::Resolver bgsend

请参阅#108745:Net :: DNS :: Resolver bgsend

这篇关于不是GLOB参考在... IO / Select.pm行61的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆