[pacman-dev] [PATCHv3 6/7] pacsearch: pattern arguments work as for pacman

Andrew Gregory andrew.gregory.8 at gmail.com
Mon Feb 10 12:35:39 EST 2014


On 02/10/14 at 06:27pm, Pierre Neidhardt wrote:
> On 14-02-10 12:15:03, Andrew Gregory wrote:
> > On 02/10/14 at 05:26pm, Pierre Neidhardt wrote:
> > > On 14-02-10 11:09:25, Andrew Gregory wrote:
> > > > On 02/09/14 at 07:41pm, Pierre Neidhardt wrote:
> > > > > +open (my $syncout, '-|', 'pacman', '-Ss', @ARGV) or exit;
> > > > 
> > > > If we can't run pacman we need to print an error message and exit
> > > > non-zero.
> > > 
> > > 'open' already prints an error message. Writing
> > 
> > So perl prints its own warning on open() failures only for pipes,
> > breaking a common idiom... brilliant.  I'm tempted to disable that
> > warning and print our own to get rid of the script name and line
> > number, but given how unlikely it is to happen, it may not be worth
> > it.  Any thoughts?  We still need to exit non-zero either way.
> > 
> > > +open (my $syncout, '-|', 'pacman', '-Ss', @ARGV) or die "pacman not found: $!";
> 
> I was quite surprised as well, considering that the above line comes directly
> from the official documentation...
> 
> How do you disable error output from open?

"no warnings 'io';" should do it.  See perldoc perllexwarn


More information about the pacman-dev mailing list