develooper Front page | perl.perl5.porters | Postings from March 2001

Re: [ID 20010225.002] [8892] Bug in n-arg open

Thread Previous
March 3, 2001 08:26
Re: [ID 20010225.002] [8892] Bug in n-arg open
Message ID:
[Quoting, on February 25 2001, 17:38, in "Re: [ID 20010225.002"]
> >When using the more-than-3-args version of 'open', apparently not all
> >arguments are passed to the command. Example:
> >
> >perl -wle 'open($fh,"-|","echo","foo"); print while <$fh>'
> >
> >This will print an empty line, since 'echo' is started, but "foo" is
> >not added to its argument list.
> Bug acknowledged - but it isn't trivial to fix. System's popen
> takes one string not a list, and perl's abstraction layers mimic that.

If it cannot be fixed easily/fast, make it a syntax error. This is
dangerous. E.g.

  open(FH, "|-", "remove_files", "--dry-run");

-- Johan

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About