Brian Ingerson <[EMAIL PROTECTED]> writes:
> "Kort, Eric" wrote:
> >
[...]
> > Why not enable it by default? Are there many times you wouldn't want to
> > inspect the files in this way when make failed?
>
> I'd rather not assume a terminal environment. The program might be
> running as a CGI or Tk app. But I will have the standard message print a
> hint to turn on debugging. Maybe there's a way to confidently detect a
> terminal environment (Unix and MSWin32). Anybody?
On POSIX, you can check if your standard input is connected to a
terminal. This can be done in Perl as follows:
<xyz 104 [9:44] ~ >perl -le 'print ((-t STDIN) ? "Yes" : "No")'
Yes
<xyz 105 [9:45] ~ >perl -le 'print ((-t STDIN) ? "Yes" : "No")' < /dev/null
No
Note, however, that it only does what it says it does. If you run a
Tk app from the command line, it will still have STDIN connected to a
terminal.
However, I'd much rather *not* have such a menu, and certainly not
*on* by default. A menu is not particularly useful to me, nor is
running the file through `less'; I use XEmacs for examining files (and
I'm sure others have their own preferences). Putting all the files in
blib_I/errors/ (and adding a reference to that directory in the error
message) is certainly good enough for me to figure out the problem.
If we *must* have this menu, I still don't want it on by default.
Production code should *never* do this sort of thing. If a user tries
to run some Perl with Inline'd code and fails due to being over disk
quota, I *don't* want her presented with a menu of files to inspect.
I want an honest error message, which can be examined and emailed me
if necessary.
At the very very very very very least, any type of interaction should
first check the environment variable PL_INLINE_ERROR_INTERACTIVE (I'm
not particular about the name) is set.
> > On a completely unrelated note, why is it that many (some?) of us (myself
> > included, though I don't know why) tend to reply to the author of these
> > inline related emails _in addition to_ [EMAIL PROTECTED], such that the author
> > gets two copies of the message?
>
> Because we're lazy. And Larry told us that's a virtue. ;)
Well, you're not getting your own personalised copy. Because.
--
Ariel Scolnicov |"GCAAGAATTGAACTGTAG" | [EMAIL PROTECTED]
Compugen Ltd. |Tel: +972-2-5713025 (Jerusalem) \ We recycle all our Hz
72 Pinhas Rosen St. |Tel: +972-3-7658117 (Main office)`---------------------
Tel-Aviv 69512, ISRAEL |Fax: +972-3-7658555 http://3w.compugen.co.il/~ariels