Skip Menu |

This queue is for tickets about the IPC-Run CPAN distribution.

Report information
The Basics
Id: 102824
Status: resolved
Priority: 0/
Queue: IPC-Run

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.94
Fixed in: (no value)



Subject: Can't locate object method "FILENO"
If STDERR is tied and does not implement a real filehandle, especially if FILENO is not implemented, then running IPC::Run with redirection fails. Here's a sample script which fails with the error message "Can't locate object method "FILENO" via package "MySTDERR" at /opt/perl-5.18.4/lib/site_perl/5.18.4/IPC/Run.pm line 1126.": #!/usr/bin/perl use strict; use warnings; use IPC::Run qw(run); #{ no warnings 'redefine'; *IPC::Run::_debug_fd = sub { }; } { package MySTDERR; use Symbol qw(geniosym); sub TIEHANDLE { return bless geniosym, __PACKAGE__ } sub PRINT { shift; print @_ } } tie *STDERR, 'MySTDERR' or die $!; my $out; run ["echo", "hello"], ">", \$out; print "out is $out\n"; __END__ If IPC::Run's _debug_fd method is made into a no-op (see the commented out line), then operation is successful. Probably the correct solution would be to check if the fileno() call is possible in _debug_fd() (using eval{} or ->can()), and just return undef otherwise.
perl recently (5.18?) made fileno get angry if a file handle wasn't open and fileno is called.
Ticket migrated to github as https://github.com/toddr/IPC-Run/issues/92