Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two "typos" in IPC::Run::IO::new [rt.cpan.org #111214] #65

Open
toddr opened this issue May 12, 2017 · 2 comments
Open

Two "typos" in IPC::Run::IO::new [rt.cpan.org #111214] #65

toddr opened this issue May 12, 2017 · 2 comments

Comments

@toddr
Copy link
Member

toddr commented May 12, 2017

Migrated from rt.cpan.org#111214 (status was 'new')

Requestors:

From ikegami@adaelis.com on 2016-01-15 16:16:34:

sub new {
   my $class = shift;
   $class = ref $class || $class;

   my ( $external, $type, $internal ) = ( shift, shift, pop );

   croak "$class: '$_' is not a valid I/O operator"
 <---------------- << $_ >> should be << $type >>
      unless $type =~ /^(?:<<?|>>?)$/;

   my IPC::Run::IO $self = $class->_new_internal(
      $type, undef, undef, $internal, undef, @_
   );

   if ( ! ref $external ) {
      $self->{FILENAME} = $external;
   }
   elsif ( ref eq 'GLOB' || UNIVERSAL::isa( $external, 'IO::Handle' ) ) {
 <---------------- << ref eq 'GLOB' >> should be << ref( $external ) eq
'GLOB' >>
      $self->{HANDLE} = $external;
      $self->{DONT_CLOSE} = 1;
   }
   else {
      croak "$class: cannot accept " . ref( $external ) . " to do I/O with";
   }

   return $self;
}

This also means that there are no tests for $io = io( *HANDLE, '<', $send );

@toddr
Copy link
Member Author

toddr commented Mar 27, 2018

@ikegami What patch are you recommending here?

@ikegami
Copy link

ikegami commented Mar 27, 2018

hmmm? It's pretty clearly stated in the previous message. Change << $_ >> to << $type >>, and change << ref eq 'GLOB' >> to << ref( $external ) eq 'GLOB' >>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants