perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Perlover <perlo...@gmail.com>
Subject Input files in Execute and PerlIO layers for theirs + object_base option doesn't work
Date Wed, 26 Sep 2012 10:17:35 GMT
Dear Gerald,

I have some problems with Embperl 2.4.0 (perl v.5.14.2)
First, i use Embperl in my own environment (no mod_perl, apache, fcgi
and etc). Only process under Starman server

I want to use Embperl as:

my $out;

Embperl::Object::Execute({
		inputfile		=> "/foo/dir/test.epl",
		object_base		=> 'base.epl',
		object_stopdir		=> "/foo/dir",
		output			=> \$out
	    })

I have some problems:

1) (BUG?) Embperl::Object doesn't see base.epl file.
I have /foo/dir/base.epl in directory!
I see in Starman's logs error as:

[1738]ERR:  404: : Not found '_base.epl', searched:

If i rename base.epl to _base.epl them my template works BUT:

2) (HELP) Other problem. I use everywhere UTF-8 encoding. My scripts
have "use utf8" and in UTF-8 encoding, files are in UTF-8
But i see that $out in my example doesn't have utf8 flag.
I think it's because Embperl open file (inputfile) without ":utf8"
layer. And it reads this file as plain binary file.
If i will use "params" with utf8 perl variables i think i will have a hell.

You write in documentation that Embperl works with UTF-8. Yes, may be
it keeps utf8 flag in variables, in outputs but i think Embperl
doesn't work correctly with input files.
Am i right?

As workaround i see simple option: inputfile_binmode in Execute
function for example. If Embperl will have this option i will happy as
i think! For example: if i use this option then Embperl opens files
under Execute and use PerlIO layer with this layer.

Certainly, i can read files myself and use 'input' option but i want
to use benefits of caching of Embperl. If i use files through Embperl
as i think the Embperl controls modification times of files and caches
theirs.

Perlover

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


Mime
View raw message