die, was (Re: CGI email)

C. Abney cabney at cyberpass.net
Sat Feb 26 04:10:20 CST 2000

On Fri, 25 Feb 2000, Sander van Zoest wrote:
> On Fri, 25 Feb 2000, C. Abney wrote:

> > wtf???  Where the heck is die printing, anyway?  And why doesn't this
> > work like (I think) it should?:
> any Carp() will be output to STDERR which in the case of a cgi script the
> error log. Any STDOUT by default would go to the web client, although
> this might not always be the case (mod_perl might not, unless you
> are using Apache::Registry () )

Well, I was trying to capture the error output and bend it to my will,
as it were.  But I don't get my 'die' text in the foo.err.txt of that
little code snippet I provided:

	# this makes it into the (STDERR redirect) error file
		unless ( -x "/usr/LIB/sendmail" );

	# this doesn't. I get the bog standard error
	# but only with warnings on.
	open SENDMAIL, "| /usr/LIB/sendmail -t"
		or die "AAAUUUUUGGGGHHHHH!!!: $!\n";

I assumed die would send it's argument (string) to STDERR.  This doesn't
seem to happen when making a system call.  Do I need to trap something?

Einstein himself said that God doesn't roll dice. But he was wrong. And
in fact, anyone who has played role-playing games knows that God
probably had to roll quite a few dice to come up with a character like
Einstein.  -- Larry Wall                                     C. Abney


The posting address is: san-diego-pm-list at hfb.pm.org

List requests should be sent to: majordomo at hfb.pm.org

If you ever want to remove yourself from this mailing list,
you can send mail to <majordomo at happyfunball.pm.org> with the following
command in the body of your email message:

    unsubscribe san-diego-pm-list

If you ever need to get in contact with the owner of the list,
(if you have trouble unsubscribing, or have questions about the
list itself) send email to <owner-san-diego-pm-list at happyfunball.pm.org> .
This is the general rule for most mailing lists when you need
to contact a human.

More information about the San-Diego-pm mailing list