develooper Front page | perl.perl6.announce.rfc | Postings from September 2000

RFC 221 (v1) system() should return useful values

From:
Perl6 RFC Librarian
Date:
September 13, 2000 13:46
Subject:
RFC 221 (v1) system() should return useful values
Message ID:
20000913204636.23633.qmail@tmtowtdi.perl.org
This and other RFCs are available on the web at
  http://dev.perl.org/rfc/

=head1 TITLE

system() should return useful values

=head1 VERSION

  Maintainer: Nathan Torkington <gnat@frii.com>
  Date: Sep 13 2000
  Mailing List: perl6-language@perl.org
  Number: 221
  Version: 1
  Status: Developing

=head1 ABSTRACT

system() should return true if the program exited normally, false
otherwise.

=head1 DESCRIPTION

In perl5, system() returns the wait status of the program: 0 if it
succeeded, a positive number if it failed.  This means you can't test
for failure with "|| die" as you can with so many other Perl
functions.

I propose changing it so that system() returns false on failure and
true on success.

It would no longer return the exit status of the program, which would
need to be collected through C<$?> or its perl6 replacement.

=head1 IMPLEMENTATION

Simple change to the pp_code for system(). 

The perl526 translator would replace system() with:

  do { system(...); $? }

=head1 REFERENCES

perlfunc manpage for description of system()

perlvar manpage for description of $?





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