You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Bill OConnor <wt...@mmrsoftware.com> on 2001/12/12 22:57:45 UTC

Cannor read file from Embperl

Installed Embperl on Solaris 5.7 Apache 1.3.19 with File::Spec .8 (the
latest File::Spec).

I can get a script to write a file but read never seems to happen.

        open (FILE, "/tmp/emb.txt") || die "open failed $!";
        $line = <FILE>;
	  return $line;

I get an error with $line = <FILE>;

"The server encountered an internal error or misconfiguration and was
unable to complete your request.
Please contact the server administrator, webmaster@ and inform them of
the time the error occurred, and anything you might have done that may
have caused the error.


[22985]ERR: 24: Error in Perl code: syntax error at index.epl line 32,
at EOF

[22985]ERR: 24: Error in Perl code: Undefined subroutine
&HTML::Embperl::DOC::_1::get_datablock called at index.epl line 109.

Apache/1.3.19 (Unix) mod_perl/1.25 HTML::Embperl 1.3.4 [Wed Dec 12
13:53:24 2001]"




The <FILE> always seems to be at EOF or something but open always works.
The file permissions are ok, the file is not empty and this works fine
in perl. Other things I do with Embperl seem to work.

Anybody know what gives?

Bill


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Cannor read file from Embperl

Posted by Gerald Richter <ri...@ecos.de>.
> I can get a script to write a file but read never seems to happen.
>
>         open (FILE, "/tmp/emb.txt") || die "open failed $!";
>         $line = <FILE>;
>   return $line;
>
> I get an error with $line = <FILE>;
>


As other already said Embperl treats <FILE> as a HTML tag in the default
configuration. There are several ways to solve this:

If you are generaly writing in an text editor set the optRawInput option in
your httpd.conf. This avoids other trouble as well. The default assumes you
are writing in an HTML editor, which would had written &lt;FILE&gt; in your
file, which is the second possibility. Addtionaly \<FILE> will also work and
you can set optRawInput inside your page by putting [- $optRawInput = 1 -]
in an extra block before your <FILE>.

Again if you use a text editor for writing the best is to set the
optRawInput Flag in the EMBPERL_OPTIONS in your httpd.conf.

Gerald

P.S. $escmode will not work, because $escmode is responsible for escaping
the your output and not the parser

-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------




---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org