develooper Front page | perl.perl5.porters | Postings from June 2004

Re: [PATCH] sort plays nethack in a scalar context

From:
H.Merijn Brand
Date:
June 25, 2004 02:51
Subject:
Re: [PATCH] sort plays nethack in a scalar context
Message ID:
20040625114820.DCB5.H.M.BRAND@hccnet.nl
On Fri 25 Jun 2004 11:27, Nicholas Clark <nick@ccl4.org> wrote:
> On Fri, Jun 25, 2004 at 04:29:04PM +1000, Paul Fenwick wrote:
> 
> >      if (gimme != G_ARRAY) {
> > +	if (PerlLIO_isatty(PerlIO_fileno(PerlIO_stdin())) &&
> > +	    PerlLIO_isatty(PerlIO_fileno(PerlIO_stdout()))) {
> > +		system(ROGUELIKE_GAME);
> 
> You're not checking the return code from system.
> In scalar context shouldn't the return value be some sort of score for this
> game of nethack?

And if Configure should define ROGUELIKE_GAME, what will happen if the binary
is used on another system that doesn't have that game?

So, if this option is enabled, it should do a runtime check on games enabled.

-- 
H.Merijn Brand        Amsterdam Perl Mongers (http://amsterdam.pm.org/)
using perl-5.6.1, 5.8.3, & 5.9.x, and 809 on  HP-UX 10.20 & 11.00, 11i,
   AIX 4.3, SuSE 9.0, and Win2k.           http://www.cmve.net/~merijn/
http://archives.develooper.com/daily-build@perl.org/   perl-qa@perl.org
send smoke reports to: smokers-reports@perl.org, QA: http://qa.perl.org





nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About