[pacman-dev] [PATCHv3 6/7] pacsearch: pattern arguments work as for pacman
ambrevar at gmail.com
Mon Feb 10 12:27:37 EST 2014
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?
Max told his friend that he'd just as soon not go hiking in the hills.
Said he, "I'm an anti-climb Max."
[So is that punchline.]
More information about the pacman-dev