2011/12/8 John W. Krahn <jwkr...@shaw.ca>
> Tessio Fechine wrote: > >> Hello, >> > > Hello, > > I have a perl script that uses Net::LDAP to query an directory service. It >> is invoked like this: >> >> --- >> search.pl '(cn=peter*)' >> --- >> >> Today I started another perl script that works on top of search.pl. It >> opens search.pl with a piped open, and them process the results. >> But I accidentally found that open acted oddly when '(cn=string*)' was >> passed to it. >> The possible bug is that when I pass a nonexistent file name fallowed by >> '(cn=string*)' to open, it do not fail. >> > > It sounds like you have a problem with the shell, not with Perl. Try > invoking your search program without getting the shell involved: > > open my $search, '-|', 'search.pl', '(cn=peter*)' > or die "Cannot open pipe from 'search.pl' because: $!"; > > Also be sure to close the piped filehandle correctly: > > close $search or warn $! ? "Error closing 'search.pl' pipe: $!" > : "Exit status $? from 'search.pl'"; > > > > John > -- > Any intelligent fool can make things bigger and > more complex... It takes a touch of genius - > and a lot of courage to move in the opposite > direction. -- Albert Einstein > > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h...@perl.org > http://learn.perl.org/ > > > I'll try this.. but if I had a problem with my shell, the open wasn't expected fail?