Subject: | Can't locate object method "fileno" via package "FileHandle" at IO-Socket-IP line 916 |
Date: | Fri, 16 Dec 2016 11:42:29 +0800 |
To: | bug-IO-Socket-IP [...] rt.cpan.org |
From: | Simon Yuen <simon [...] neto.com.au> |
Hi,
I would like to report a bug on the following error.
*Can't locate object method "fileno" via package "FileHandle" at
vendor/perl/lib/perl5/IO/Socket/IP.pm line 916*
907:sub socket :method
Show quoted text
> 908:{
> 909: my $self = shift;
> 910: return $self->SUPER::socket(@_) if not defined $self->fileno;
> 911: return $self->SUPER::socket(@_); # I added this line and works
> 912:
> 913: # I hate core prototypes sometimes...
> 914: socket( my $tmph, $_[0], $_[1], $_[2] ) or return undef;
> 915:
> 916: dup2( $tmph->fileno, $self->fileno ) or die "Unable to dup2 $tmph
> onto $self - $!";
> 917:}
It is called from LWP::UserAgent with parameter $_[0]=2, $_[1]=1, $_[2]=6
I guess the line
dup2( $tmph->fileno, $self->fileno ) or die "Unable to dup2 $tmph onto
Show quoted text> $self - $!"
can be changed to
dup2( fileno($tmph), $self->fileno ) or die "Unable to dup2 $tmph onto
Show quoted text> $self - $!";
to avoid the above issue
Thank you.
--
Regards,
Simon
<https://www.neto.com.au>
Simon Yuen
+61 7 3077 9696 <+61+7+3077+9696> | +852 9547 4422 <+852+9547+4422>
simon@neto.com.au <maxine@neto.com.au>
www.neto.com.au
Unless expressly stated otherwise, this message is confidential and may be
privileged. It is intended for the addressee(s) only. Access to this e-mail
by anyone else is unauthorised. If you are not an addressee, any disclosure
or copying of the contents of this e-mail or any action taken (or not
taken) in reliance on it is unauthorised and may be unlawful. If you are
not an addressee, please inform the sender immediately. Neto E-commerce
Solutions does not warrant that this email and any attachments are error or
virus free and recommends that all attachments be checked for computer
viruses.