Re: Exiting without printing



Daniel Kaplan wrote:
> Can someone direct me to the proper perldoc file which explains the
> easiest way to exit a Perl app?

perldoc -f exit

> I am writing a script that is run by the server once an hour, not via
> a web browser. But a simple :
>
> exit (0); //causes Perl app to fail

I don't believe you.
There is just about no way that this command could cause a program to fail
by any reasonable definition of "fail".

> If I precede it with :
>
> print $q->header();
> print "";
>
> Then everything is ok. Maybe it's nothing, but it just bothers me
> to have to do this output which servers no purpose.

I cannot repro your problem:

C:\tmp>type t.pl
use strict;
use warnings;
#do whatever you please
exit (0);
C:\tmp>t.pl

C:\tmp>

Obviously t.pl did not fail.

Please post a minimal but complete program that demonstrates the problem.
Also, please be more precise in describing in what you expect to happen
versus the actual behaviour of the program. Saying "it fails" is about as
informative as saying "my car doesnt' run" and can have just about as many
reasons from missing gas to a broken transmission or flat tires.

jue


.



Relevant Pages

  • Re: Printing files every step
    ... snip ... ... your code is 100% correct from the coding and logic points of view. ... Does "the user has to close files properly" imply that if I fail to ... Note that the standard says that exit() closes all open streams (and ...
    (comp.lang.c)
  • Scheduling in SICStus Prolog using CLPr
    ... For the query "schedule(OptimumSchedule, EarliestFinishTime)." ... as in Scheduling-Part2.pl as attached herewith (refer to the ... + 9 9 Exit: ... + 4 4 Fail: ...
    (comp.lang.prolog)
  • Re: I need help please!
    ... santosh wrote in message ... It can fail when the operator sends the end-of-file sequence ... wish to exit from the program. ... writing menus and prompts and dialog boxes and stupid crap like ...
    (comp.lang.c)
  • Re: "gdth: update deprecated pci_find_device" is incorrect
    ... in jejb/scsi-rc-fixes-2.6.git is incorrect. ... You don't decrement pci refcount on exit. ... Also you do not so on fail paths... ...
    (Linux-Kernel)