The LOG filehandle is predefined by Embperl.  Anything written to it is put
into Embperl's log file (usually /tmp/embperl.log).  If you use a different
name, you will probably be OK.  On the other hand, you can just delete the
call to "open" (and "close) and use the log file Embperl already provides.

BTW, "LOG" and several other variables are discussed in the "Predefined
variables" section of the HTML::Embperl man page.

--
Greg Estep <[EMAIL PROTECTED]>
#include <std/disclaimer.h>


-----Original Message-----
From: Toni Mueller [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 02, 2000 10:18 AM
To: [EMAIL PROTECTED]
Subject: Embperl struggles

Hello,

trying to develop with Embperl I encounter the following
problems:

1. Using a sequence of statements like

  [-
  open LOG, ">/tmp/logfile.txt";
  print LOG "some debug info: $var\n";
  close LOG;
  -]

  ever gets me the following error:
  error in Perl code: Can't locate object method "CLOSE" via package
"HTML::Embperl::Log"

  but I don't understand why. I can't remember getting this error code
  for other Perl code. Defining a function that contains this code and
  require'ing this doesn't help, but using a full-blown package and
  instantiating this is ok, albeit imho heavily oversized.

2. requrire'ing a file that defines some functions sometimes gives me
   an error that the functions in that file are _not_ defined...

3. I have a hard time understanding when to use [- -] and when to use
   [! !] or [* *]. Most of what I've done so far uses [- -] and
   [$ $] (which I so far have no trouble with). The scoping and
   execution time issues are not that clear to me.

Last but not least I'd like some kind of pretty printer since my
Emacs won't help me here. I tried the two things mentioned on the
web, but to no avail (one requiring Xemacs instead of Emacs, too).

This is all with apache 1.3.10, mod-perl 1.21 and Embperl 1.2.1
(I also have no Perl 5.6.0 yet, only 5.005).


Any help is greatly appreciated!


Best Regards,
--Toni++


Reply via email to