RE: Embperl

1999-11-03 Thread Gerald Richter

>
> I use HTML-Embperl-1.2b10:
>
>
> How make $http_headers_out{'Location'} ,so as
>
>   redirect 
>

I would try

$url = "http://$ENV{SERVER_NAME}/path/to/edit.html?" ;
while (($k, $v) = each (%fdat))
{
$url .= "$k=$v&" ;
}

$http_headers_out{'location'} = $url ;

Gerald

>
> --
>
>   ó ÎÁÉÌÕÞÛÉÍÉ ÐÏÖÅÌÁÎÉÑÍÉ, å×ÇÅÎÉÊ âÙÒÇÁÎÏ×.
>   Best regards, Eugene Byrganov
>
>   mailto:[EMAIL PROTECTED].
>   work - http://www.inp.nsk.su/
>



RE: Embperl

1999-11-03 Thread Jason Bodnar

That'll work but you'll end up with an extra ampersand on the end. Here map()
and join() are your friends:

[- $http_headers_out{'Location'} = q(edit.html?) . join('&', map({$_=$fdat{$_}} 
keys %fdat)) -]

On 03-Nov-99 Gerald Richter wrote:
>>
>> I use HTML-Embperl-1.2b10:
>>
>>
>> How make $http_headers_out{'Location'} ,so as
>>
>>   redirect 
>>
> 
> I would try
> 
> $url = "http://$ENV{SERVER_NAME}/path/to/edit.html?" ;
> while (($k, $v) = each (%fdat))
>   {
>   $url .= "$k=$v&" ;
>   }
> 
> $http_headers_out{'location'} = $url ;
> 
> Gerald
> 
>>
>> --
>>
>>   ó ÎÁÉÌÕÞÛÉÍÉ ÐÏÖÅÌÁÎÉÑÍÉ, å×ÇÅÎÉÊ âÙÒÇÁÎÏ×.
>>   Best regards, Eugene Byrganov
>>
>>   mailto:[EMAIL PROTECTED].
>>   work - http://www.inp.nsk.su/
>>

---
Jason Bodnar + [EMAIL PROTECTED] + Tivoli Systems

I swear I'd forget my own head if it wasn't up my ass. -- Jason Bodnar



RE: Embperl

1999-11-03 Thread Gerald Richter

>
> That'll work but you'll end up with an extra ampersand on the
> end. Here map()
> and join() are your friends:
>
> [- $http_headers_out{'Location'} = q(edit.html?) . join('&',
> map({$_=$fdat{$_}}
> keys %fdat)) -]
>
Yes, that's more elegant, but is it possible that you forgot a qq before
{$_=$fdat{$_}}?

->  map(qq{$_=$fdat{$_}} keys %fdat)

Gerald



RE: Embperl

1999-11-03 Thread Jason Bodnar


On 03-Nov-99 Gerald Richter wrote:
>>
>> That'll work but you'll end up with an extra ampersand on the
>> end. Here map()
>> and join() are your friends:
>>
>> [- $http_headers_out{'Location'} = q(edit.html?) . join('&',
>> map({$_=$fdat{$_}}
>> keys %fdat)) -]
>>
> Yes, that's more elegant, but is it possible that you forgot a qq before
> {$_=$fdat{$_}}?
> 
> ->  map(qq{$_=$fdat{$_}} keys %fdat)

Yes indeed. I really need to quit typing perl directly into my email client and
actually test it out first. Last thing this world needs is more bad perl code
floating around.

---
Jason Bodnar + [EMAIL PROTECTED] + Tivoli Systems

That boy wouldn't know the difference between the Internet and a hair net. --
Jason Bodnar



Re: Embperl

1999-01-02 Thread Eugene B. Byrganov

Gerald Richter wrote:

> >
> >
> > How make $http_headers_out{'Location'} ,so as
> >
> >   redirect 
> >
> 
> I would try
> 
> $url = "http://$ENV{SERVER_NAME}/path/to/edit.html?" ;
> while (($k, $v) = each (%fdat))
> {
> $url .= "$k=$v&" ;
> }
> 
> $http_headers_out{'location'} = $url ;
> 
I am making too:

   $url="edit.html\?";
   foreach $i ( keys %fdat)
 {
 $_=$fdat{$i};
 s/([^a-zA-Z0-9-._])/uc sprintf("%%%02x",ord($1))/eg;
 $url.="$i=$_\&";
 }
   $url.="lock=$lock";
  $http_headers_out{'Location'} = "$url"; 

But this don't good idea,
' redirect  ' - more elegant.
 
Another quistion: how use 'struct tCharTrans Char2Url' in perl code 
for escaping any strings?
My be in TODO?


-- 

  ó ÎÁÉÌÕÞÛÉÍÉ ÐÏÖÅÌÁÎÉÑÍÉ, å×ÇÅÎÉÊ âÙÒÇÁÎÏ×.
  Best regards, Eugene Byrganov

  mailto:[EMAIL PROTECTED].
  work - http://www.inp.nsk.su/



RE: Embperl

1999-01-02 Thread Gerald Richter

> > >
> > >
> > > How make $http_headers_out{'Location'} ,so as
> > >
> > >   redirect 
> > >
> >
> > I would try
> >
> > $url = "http://$ENV{SERVER_NAME}/path/to/edit.html?" ;
> > while (($k, $v) = each (%fdat))
> > {
> > $url .= "$k=$v&" ;
> > }
> >
> > $http_headers_out{'location'} = $url ;
> >
> I am making too:
>
>$url="edit.html\?";
>foreach $i ( keys %fdat)
>  {
>  $_=$fdat{$i};
>  s/([^a-zA-Z0-9-._])/uc sprintf("%%%02x",ord($1))/eg;
>  $url.="$i=$_\&";
>  }
>$url.="lock=$lock";
>   $http_headers_out{'Location'} = "$url";
>
> But this don't good idea,
> ' redirect  ' - more elegant.
>
> Another quistion: how use 'struct tCharTrans Char2Url' in perl code
> for escaping any strings?

You could only use it when you output data by writing

[- $escmode = 2 -]

but it's not possible to apply it to perl data

> My be in TODO?
>

I can put it on the TODO list, but there are other perl modules (CGI, LWP)
which can do the job for you, so I don't give it a very high priority

Gerald



>
> --
>
>   ó ÎÁÉÌÕÞÛÉÍÉ ÐÏÖÅÌÁÎÉÑÍÉ, å×ÇÅÎÉÊ âÙÒÇÁÎÏ×.
>   Best regards, Eugene Byrganov
>
>   mailto:[EMAIL PROTECTED].
>   work - http://www.inp.nsk.su/
>



Re: Embperl

1999-01-02 Thread Eugene B. Byrganov

Gerald Richter wrote:

> > I am making too:
> >
> >$url="edit.html\?";
> >foreach $i ( keys %fdat)
> >  {
> >  $_=$fdat{$i};
> >  s/([^a-zA-Z0-9-._])/uc sprintf("%%%02x",ord($1))/eg;
> >  $url.="$i=$_\&";
> >  }



> > Another quistion: how use 'struct tCharTrans Char2Url' in perl code
> > for escaping any strings?
 
> I can put it on the TODO list, but there are other perl modules (CGI, LWP)
> which can do the job for you, so I don't give it a very high priority

Ok!

P.S. I search std. function for escaping, but don't found anywhere in 
perl modules. Only internal in CGI.pm I found this string 's/([^a-zA-Z0-9-._]) ...', 
but without possible to call function from my code.

-- 

  ó ÎÁÉÌÕÞÛÉÍÉ ÐÏÖÅÌÁÎÉÑÍÉ, å×ÇÅÎÉÊ âÙÒÇÁÎÏ×.
  Best regards, Eugene Byrganov

  mailto:[EMAIL PROTECTED].
  work - http://www.inp.nsk.su/



Re: Embperl

1999-01-02 Thread Geoffrey Crawshaw


> Gerald Richter wrote:
> 
> > > I am making too:
> > >
> > >$url="edit.html\?";
> > >foreach $i ( keys %fdat)
> > >  {
> > >  $_=$fdat{$i};
> > >  s/([^a-zA-Z0-9-._])/uc sprintf("%%%02x",ord($1))/eg;
> > >  $url.="$i=$_\&";
> > >  }
> 
> 
> 
> > > Another quistion: how use 'struct tCharTrans Char2Url' in perl code
> > > for escaping any strings?
>  
> > I can put it on the TODO list, but there are other perl modules (CGI, LWP)
> > which can do the job for you, so I don't give it a very high priority
> 
> Ok!
> 
> P.S. I search std. function for escaping, but don't found anywhere in 
> perl modules. Only internal in CGI.pm I found this string 's/([^a-zA-Z0-9-._]) ...', 
> but without possible to call function from my code.

Use the escape and unescape functions in CGI.pm to URL encode text
CGI::escape('text to escape');
CGI::unescape('text to unescape');

-- 
Geoff Crawshaw
CTO
TimeBills.com Inc.
[EMAIL PROTECTED]
http://www.timebills.com



RE: Embperl

1999-11-09 Thread Gerald Richter

Hi,
>
> as (without duplication row and column):
>
> 
> 
> 1/1 
> 
> 
> 2/1 
> 2/2 
> 
>
> 
> 3/1 
>
> 3/2 
>
> 3/3 
> 
> 
>
> It's real idea?
>

You can do this already, if you rows and columns are dividable by 2 you can
use the following code:



[+ $a[$row*2][$col*2] +] 
[+ $a[$row*2][$col*2+1] +] 


[+ $a[$row*2+1][$col*2] +] 
[+ $a[$row*2+1][$col*2+1] +] 



a more generic solution would be to write:



[+
$a[$row][$col] +] 



> Second question: many Web editor programs insert in HTML-doc
> only one tag  or  - without  or , as this write in
> http://www.w3.org/TR/REC-html40/struct/tables.html#edef-TR
> But Embperl return error!!! This is real necessary? May be interpret new
>  or , as + or +?
>

I add this to the TODO list

Gerald

---
Gerald Richter  ecos electronic communication services gmbh
Internet - Infodatenbanken - Apache - Perl - mod_perl - Embperl

E-Mail: [EMAIL PROTECTED] Tel:+49-6133/925151
WWW:http://www.ecos.de  Fax:+49-6133/925152
---




Re: embperl

2001-09-06 Thread iain truskett

* Diego V ([EMAIL PROTECTED]) [07 Sep 2001 06:59]:

[...]
> Just wanted to ask to any embperl user, is there any real advantage
> about using embperl instead of PHP ?

You get the advantage of using Perl rather than PHP.

This includes the vast resources of CPAN.

Personally, I recommend Mason  over Embperl
simply because I prefer the way it integrates into HTML.

Investigate both =)

I've done reasonably sized projects with both and find Mason cleaner
(mostly in its handling of scope and the way it doesn't use all those [-
[+ [# [$ [* etc. tags and instead just has <%, <%init and other wordy
ones: easier to remember =). )


cheers,
-- 
iain.  
"The only disadvantage I see is that it would force everyone to get
 Perl. Horrors. :-)" --Larry Wall in <[EMAIL PROTECTED]>



Re: embperl

2001-09-07 Thread Jim Cox



This will sould like sour grapes,. But!

Since PHP module compiles,... and Mod_Perl will not on AIX with 
gcc compiler

I'm thinkin' PHP is getting better and better all the time.

iain truskett wrote:
> 
> * Diego V ([EMAIL PROTECTED]) [07 Sep 2001 06:59]:
> 
> [...]
> > Just wanted to ask to any embperl user, is there any real advantage
> > about using embperl instead of PHP ?
> 
> You get the advantage of using Perl rather than PHP.
> 
> This includes the vast resources of CPAN.
> 
> Personally, I recommend Mason  over Embperl
> simply because I prefer the way it integrates into HTML.
> 
> Investigate both =)
> 
> I've done reasonably sized projects with both and find Mason cleaner
> (mostly in its handling of scope and the way it doesn't use all those [-
> [+ [# [$ [* etc. tags and instead just has <%, <%init and other wordy
> ones: easier to remember =). )
> 
> cheers,
> --
> iain.  
> "The only disadvantage I see is that it would force everyone to get
>  Perl. Horrors. :-)" --Larry Wall in <[EMAIL PROTECTED]>

-- 
Jim Cox (mailto:[EMAIL PROTECTED]) 
(817) 315-8134   (888) 834-7656 Toll Free
(817) 315-8253 FAX
(817) 233-8567 Mobile



Re: embperl

2001-09-07 Thread iain truskett

* Jim Cox ([EMAIL PROTECTED]) [07 Sep 2001 08:03]:

> This will sould like sour grapes,. But!

> Since PHP module compiles,... and Mod_Perl will not on AIX with gcc
> compiler

> I'm thinkin' PHP is getting better and better all the time.

It's all a case of "use what works" =)

There's something peculiar with one of my Apaches in that it refuses to
use DSOs. And I've got mod_perl happily compiled into it.

On my home site, the admin of the machine has PHP installed but not
mod_perl.

At work, I haven't been able to convince the sysadmin to install either.
And if I do, he's more likely to go for PHP since it's less likely to
require many configuration changes. mod_perl can attach modules to any
part of a request/response phase and thus can be configured somewhat
complexly.

PHP is just a content handler, right?

mod_perl is an everything handler: content, headers, logging, URI
translation, etc. etc. It's more powerful. As far as I know, there's
nothing PHP can do that mod_perl can't.

Well, apart from compile on AIX with gcc =)


cheers,
-- 
iain.  



Re: embperl

2001-09-07 Thread Jens-Uwe Mager

On Mon, May 07, 2001 at 02:44:13AM -0500, Jim Cox wrote:
> 
> 
> This will sould like sour grapes,. But!
> 
> Since PHP module compiles,... and Mod_Perl will not on AIX with 
> gcc compiler

As far as I have heard mod_perl will compile using gcc, only you must
first compile your perl with gcc. As mod_perl picks up the compiler
settings from the perl installation you must first compile perl with the
proper compiler. But IBM does ship perl compiled using their compiler,
so if you are lazy and do not recompile perl you are hosed.

-- 
Jens-Uwe Mager

HELIOS Software GmbH
Steinriede 3
30827 Garbsen
Germany

Phone:  +49 5131 709320
FAX:+49 5131 709325
Internet:   [EMAIL PROTECTED]



Re: embperl

2001-09-07 Thread Jim Cox


Well,... Now that makes some sense. I'll try that.


Thanks.

Jens-Uwe Mager wrote:
> 
> On Mon, May 07, 2001 at 02:44:13AM -0500, Jim Cox wrote:
> >
> >
> > This will sould like sour grapes,. But!
> >
> > Since PHP module compiles,... and Mod_Perl will not on AIX with
> > gcc compiler
> 
> As far as I have heard mod_perl will compile using gcc, only you must
> first compile your perl with gcc. As mod_perl picks up the compiler
> settings from the perl installation you must first compile perl with the
> proper compiler. But IBM does ship perl compiled using their compiler,
> so if you are lazy and do not recompile perl you are hosed.

I'm not the lazy type, just did not realize that.  I'm not using
the IBM perl distribution and I thought it was compiled with gcc,... but
I will check that.

> 
> --
> Jens-Uwe Mager
> 
> HELIOS Software GmbH
> Steinriede 3
> 30827 Garbsen
> Germany
> 
> Phone:  +49 5131 709320
> FAX:+49 5131 709325
> Internet:   [EMAIL PROTECTED]

-- 
Jim Cox (mailto:[EMAIL PROTECTED]) 
(817) 315-8134   (888) 834-7656 Toll Free
(817) 315-8253 FAX
(817) 233-8567 Mobile



Re: embperl

2001-09-07 Thread Perrin Harkins

> Just wanted to ask to any embperl user, is there any real advantage
> about using embperl instead of PHP ?

If you want a high-level summary of Embperl features, you could take a look
at my article on perl.com:
http://www.perl.com/pub/a/2001/08/21/templating.html

- Perrin




Re: embperl

2001-09-07 Thread Ask Bjoern Hansen

On Fri, 7 Sep 2001, Diego V wrote:

> Just wanted to ask to any embperl user, is there any real advantage
> about using embperl instead of PHP ?

http:[EMAIL PROTECTED]/msg01457.html
http:[EMAIL PROTECTED]/msg01461.html


 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/ !try; do();
more than a billion impressions per week, http://valueclick.com




Re: embperl

2001-09-08 Thread Medi Montaseri


Another advantage of Perl is that you can use this language in other
situations as well. Unlike PHP, or ColdFusion or other languages
who need something to tow them...you know like an RV without a head,
Perl has actaully an engine and gearbox as well.

On Fri, 7 Sep 2001, Diego V wrote:

> 
> 
> Hi there,
> 
> Just wanted to ask to any embperl user, is there any real advantage
> about using embperl instead of PHP ?
> 
> 
> Thank you
> 
> Diego Ventrice
> 
> _
> Descargue GRATUITAMENTE MSN Explorer en http://explorer.msn.es/intl.asp
> 
> 

-- 
-
Medi Montaseri   [EMAIL PROTECTED]
Unix Distributed Systems EngineerHTTP://www.CyberShell.com
CyberShell Engineering
-




Re: embperl

2001-09-08 Thread iain truskett

* Medi Montaseri ([EMAIL PROTECTED]) [08 Sep 2001 22:58]:

> Another advantage of Perl is that you can use this language in other
> situations as well. Unlike PHP, or ColdFusion or other languages who
> need something to tow them.
[...]

Much as I hate to give PHP a pro rather than a con, I must point out
that PHP can be used independently from a web service. It can be happily
used as a general purpose scripting language.

Of course, you don't get CPAN...


cheers,
-- 
iain.  

 PGP signature


RE: Embperl configurability

1999-10-16 Thread Gerald Richter

>
>
> We're attempting to implement Embperl on an already-existing,
> relatively large
> website whose HTML writers/users number well over 400. We're
> finding that a
> large minority of documents already have the left square bracket
> followed by
> one of the special characters (+-*#$!) within them, obviously not
> intended to
> be interpreted as perl code.
>
> I'd like to suggest that Embperl be configurable (at worst during compile
> time, at best in apache run-time configuration files) with respect to what
> characters are used to mark the beginning and end of Embperl. For
> instance,
> I'd like to be able to use HTML comments instead of square brackets:
>
> 
>
> I do see in the documentation that "Embperl does not use SGML
> comments (i.e.,
>  or similar things) because some HTML editors can't
> create them, or
> it's much more complicated. Since every HTML editor takes (or
> should take) `['
> and `]' as normal text, there should be no problem." I suppose there are
> multiple sides to every problem, which speaks more to the idea
> that the code
> wrapper text should be configurable.
>
> Better still, would be the ability to configure from a single +,
> which is very
> common in existing HTML documents, to another character set: perhaps
> double-plus, perhaps EVAL-OUT.
>
> 
>

I agree that makeing the [+/-... -/+] configurable would be a good idea. The
problem is, that it isn't that easy. While it would not be much work to just
change the [ to any other character, things like 
>

In the above example that works, because you have a multi-char delimiter.
But [+ EVAL-OUT ], would be often misinterpreted, because the ] is very
common to perl code.

Makeing things configurable would solve all your problems, but I will not
make such a great change, which will touch a lot of code, before the 1.2
release version.

I put it on the TODO list for 1.3

Gerald



> Regards,
> Christian
>
> -
> Christian Gilmore
> Senior Technical Staff Member
> AT&T Labs IP Technology, Florham Park
> [EMAIL PROTECTED]
> http://www.research.att.com/info/cgilmore
>





---
Gerald Richter  ecos electronic communication services gmbh
Internet - Infodatenbanken - Apache - Perl - mod_perl - Embperl

E-Mail: [EMAIL PROTECTED] Tel:+49-6133/925151
WWW:http://www.ecos.de  Fax:+49-6133/925152
---




RE: Embperl: %http_headers_out

1999-10-20 Thread Gerald Richter

>
>
> I'm preparing a class on HTML::Embperl for my company. I came across
> %http_headers_out in the Embperl documentation. I've never used it before
> thought it would definitely be useful for the beginning Embperl user. So I
> created a page that just contains:
>
> [- $http_headers_out{'Location'} = q(http://www.yahoo.com) -]
>
> When I load the page I get a blank page. It does not redirect. Am I doing
> something wrong? Has anybody used this for redirects? I normally use the
> $req_rec object but this seems like a cleaner solution if it works.

%http_headers_out is new in 1.2b10, that's explains why you never used it
:-)

I have tested it before I released it and it had worked...

Please try to fetch the page with the LWP GET and look what headers are
created:

GET -s -e http://localhost/path/page.htm

BTW. You are using 1.2b10? If not you have to first upgrade to 1.2b10 :-)

Gerald



RE: Embperl: %http_headers_out

1999-10-20 Thread Jason Bodnar

I didn't have 1.2b10. That was the problem. You may want to add a note to
%http_headers_out in the docs that it requires 1.2b10. Thanks for you help.

On 20-Oct-99 Gerald Richter wrote:
>>
>>
>> I'm preparing a class on HTML::Embperl for my company. I came across
>> %http_headers_out in the Embperl documentation. I've never used it before
>> thought it would definitely be useful for the beginning Embperl user. So I
>> created a page that just contains:
>>
>> [- $http_headers_out{'Location'} = q(http://www.yahoo.com) -]
>>
>> When I load the page I get a blank page. It does not redirect. Am I doing
>> something wrong? Has anybody used this for redirects? I normally use the
>> $req_rec object but this seems like a cleaner solution if it works.
> 
> %http_headers_out is new in 1.2b10, that's explains why you never used it
>:-)
> 
> I have tested it before I released it and it had worked...
> 
> Please try to fetch the page with the LWP GET and look what headers are
> created:
> 
> GET -s -e http://localhost/path/page.htm
> 
> BTW. You are using 1.2b10? If not you have to first upgrade to 1.2b10 :-)
> 
> Gerald

---
Jason Bodnar + [EMAIL PROTECTED] + Tivoli Systems

I strive for greatness, but will settle for mediocrity. -- Jason Bodnar



RE: Embperl: %http_headers_out

1999-10-20 Thread Gerald Richter

> 
> I didn't have 1.2b10. That was the problem. You may want to add a note to
> %http_headers_out in the docs that it requires 1.2b10. Thanks for 
> you help.
> 

yes, I add a note. I just forgot it when I wrote the docs

Gerald

> On 20-Oct-99 Gerald Richter wrote:
> >>
> >>
> >> I'm preparing a class on HTML::Embperl for my company. I came across
> >> %http_headers_out in the Embperl documentation. I've never 
> used it before
> >> thought it would definitely be useful for the beginning 
> Embperl user. So I
> >> created a page that just contains:
> >>
> >> [- $http_headers_out{'Location'} = q(http://www.yahoo.com) -]
> >>
> >> When I load the page I get a blank page. It does not redirect. 
> Am I doing
> >> something wrong? Has anybody used this for redirects? I 
> normally use the
> >> $req_rec object but this seems like a cleaner solution if it works.
> > 
> > %http_headers_out is new in 1.2b10, that's explains why you 
> never used it
> >:-)
> > 
> > I have tested it before I released it and it had worked...
> > 
> > Please try to fetch the page with the LWP GET and look what headers are
> > created:
> > 
> > GET -s -e http://localhost/path/page.htm
> > 
> > BTW. You are using 1.2b10? If not you have to first upgrade to 
> 1.2b10 :-)
> > 
> > Gerald
> 
> ---
> Jason Bodnar + [EMAIL PROTECTED] + Tivoli Systems
> 
> I strive for greatness, but will settle for mediocrity. -- Jason Bodnar
> 



Re: Embperl [- -] annoyance

1999-11-09 Thread Steve Willer


On Tue, 9 Nov 1999, David Bushong wrote:

> I was wondering (as Embperl embraces so very many hacks for the sake of 
> usefulness =) if it would be considered favorable to add a special case
> for -] occurring inside of a regexp to be _not_ considered the end of
> a embedded perl block.

Ouch! Just last night, I had spent a good half-hour or perhaps even an
hour trying to make a simple regular expression work. It had [^-] in it,
and that's where the problem was (it said the replace spec was not
terminated or something). 

Well, now I know.



RE: Embperl [- -] annoyance

1999-11-09 Thread Christian Gilmore

This would be taken care of if the delimiters for Embperl tags weren't so
common in everyday use. Gerald has said he'll work on making the delimiters
definable (so one could use straight html comments, for instance) in the next
version (ie, 1.3).

Regards,
Christian

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of David Bushong
> Sent: Tuesday, November 09, 1999 5:22 AM
> To: [EMAIL PROTECTED]
> Subject: Embperl [- -] annoyance
>
>
> I was wondering (as Embperl embraces so very many hacks for
> the sake of
> usefulness =) if it would be considered favorable to add a
> special case
> for -] occurring inside of a regexp to be _not_ considered the end of
> a embedded perl block.
>
> (This may have come up before, I haven't been following the
> list, sorry)
>
> A few times in the past months (I've been playing with
> Embperl a lot, it's
> a hell of a lot more fun than JSP, straight CGI, or 
> HTML::Template),
> I've wanted to refer to the set of characters not equal to
> "-" in a regexp.
> Unfortunately, this results in  /...[^\-]+.../ or something
> to that effect.
> Other times, I've referred to a larger set of characters, and
> - happened
> to be at the end, causing the page to break with a very
> confusing error.
> While the simplest workaround is probably /...[^\55]+.../, that seems
> pretty silly.
>
> Thoughts?
>
> --David Bushong
>



Re: Embperl [- -] annoyance

1999-11-09 Thread Cliff Rayman

here's a suggestion - although I did not try it.

[! $expr="[^-]+"; !]
[- $testdata=~m!$expr!go; -]

if not - probably can work around it by placing this code in
a separate module and calling it with embperl.

looks like we need some kind of embperl escape character.
no matter what you choose for embperl delimiters it can be broken
somewhere.

cliff rayman
genwax.com

Steve Willer wrote:

> On Tue, 9 Nov 1999, David Bushong wrote:
>
> > I was wondering (as Embperl embraces so very many hacks for the sake of
> > usefulness =) if it would be considered favorable to add a special case
> > for -] occurring inside of a regexp to be _not_ considered the end of
> > a embedded perl block.
>
> Ouch! Just last night, I had spent a good half-hour or perhaps even an
> hour trying to make a simple regular expression work. It had [^-] in it,
> and that's where the problem was (it said the replace spec was not
> terminated or something).
>
> Well, now I know.



RE: Embperl [- -] annoyance

1999-11-09 Thread Gerald Richter

>
> I was wondering (as Embperl embraces so very many hacks for the sake of
> usefulness =) if it would be considered favorable to add a special case
> for -] occurring inside of a regexp to be _not_ considered the end of
> a embedded perl block.
>
> (This may have come up before, I haven't been following the list, sorry)
>
> A few times in the past months (I've been playing with Embperl a lot, it's
> a hell of a lot more fun than JSP, straight CGI, or 
> HTML::Template),
> I've wanted to refer to the set of characters not equal to "-" in
> a regexp.
> Unfortunately, this results in  /...[^\-]+.../ or something to
> that effect.
> Other times, I've referred to a larger set of characters, and - happened
> to be at the end, causing the page to break with a very confusing error.
> While the simplest workaround is probably /...[^\55]+.../, that seems
> pretty silly.
>

The problem is how to determinate, if we are inside are regex. I don't can
think of a easy way to do so, without building a second perl parser.
(Somebody said, "Only Perl is able to correctly parse Perlcode"). There are
so much possibilties that could be a regex. Also counting open and close
square braces will not work, because of code like

/[\[-]/

Someday, when I build Embperl 2.0 with a new parser, such things may
possible, maybe...

Gerald

P.S. If you have an esay way to determinate if we are inside a regex, let me
know and I will put it into Embperl.



---
Gerald Richter  ecos electronic communication services gmbh
Internet - Infodatenbanken - Apache - Perl - mod_perl - Embperl

E-Mail: [EMAIL PROTECTED] Tel:+49-6133/925151
WWW:http://www.ecos.de  Fax:+49-6133/925152
---



RE: Embperl [- -] annoyance

1999-11-09 Thread Gerald Richter

>
> This would be taken care of if the delimiters for Embperl tags weren't so
> common in everyday use.

Sorry, but in my "everyday use" they are not so common. The only case I know
where it occur, is the regex that David and Steve described. Are you know
other cases, where this will be a problem?

> Gerald has said he'll work on making the
> delimiters
> definable (so one could use straight html comments, for instance)
> in the next
> version (ie, 1.3).
>

Yes, I will add the options the configure it. This may solves some problems,
other delimiters may create other problems...

I have choosen the [-/+ ... +/-] very carefully to avoid such situation as
often as possible, also there maybe better delimiters, but with HTML comment
for example, things like

 will not work, because you can't nest html tags.

Gerald

---
Gerald Richter  ecos electronic communication services gmbh
Internet - Infodatenbanken - Apache - Perl - mod_perl - Embperl

E-Mail: [EMAIL PROTECTED] Tel:+49-6133/925151
WWW:http://www.ecos.de  Fax:+49-6133/925152
---



RE: Embperl [- -] annoyance

1999-11-09 Thread Gerald Richter

> here's a suggestion - although I did not try it.
>
> [! $expr="[^-]+"; !]
> [- $testdata=~m!$expr!go; -]
>

I also didn't tried it, but it should work this way.

> if not - probably can work around it by placing this code in
> a separate module and calling it with embperl.
>

Would work also, but seems too complicated to me.

> looks like we need some kind of embperl escape character.

What do you mean by "embperl escape character"?

> no matter what you choose for embperl delimiters it can be broken
> somewhere.
>

Yes.

The simplest solution I see for now, is what David posted in his first mail:

/...[^\55]+.../

use \55 instead of -

Gerald

---
Gerald Richter  ecos electronic communication services gmbh
Internet - Infodatenbanken - Apache - Perl - mod_perl - Embperl

E-Mail: [EMAIL PROTECTED] Tel:+49-6133/925151
WWW:http://www.ecos.de  Fax:+49-6133/925152
---



RE: Embperl [- -] annoyance

1999-11-09 Thread Christian Gilmore

Auto-generated mathematica output... People who choose to put optional
information within a document inside of brackets... I have hundreds of
examples here on our site  (http://www.research.att.com/) where we've bumped
up against the use of square brackets followed by one of the key characters
used for purposes not intended to be Embperl...

Regards,
Christian

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Gerald Richter
> Sent: Tuesday, November 09, 1999 1:53 PM
> To: Christian Gilmore; 'David Bushong'; [EMAIL PROTECTED]
> Subject: RE: Embperl [- -] annoyance
>
>
> >
> > This would be taken care of if the delimiters for Embperl
> tags weren't so
> > common in everyday use.
>
> Sorry, but in my "everyday use" they are not so common. The
> only case I know
> where it occur, is the regex that David and Steve described.
> Are you know
> other cases, where this will be a problem?
>
> > Gerald has said he'll work on making the
> > delimiters
> > definable (so one could use straight html comments, for instance)
> > in the next
> > version (ie, 1.3).
> >
>
> Yes, I will add the options the configure it. This may solves
> some problems,
> other delimiters may create other problems...
>
> I have choosen the [-/+ ... +/-] very carefully to avoid such
> situation as
> often as possible, also there maybe better delimiters, but
> with HTML comment
> for example, things like
>
>  will not work, because you can't
> nest html tags.
>
> Gerald
>
> ---
> Gerald Richter  ecos electronic communication services gmbh
> Internet - Infodatenbanken - Apache - Perl - mod_perl - Embperl
>
> E-Mail: [EMAIL PROTECTED] Tel:+49-6133/925151
> WWW:http://www.ecos.de  Fax:+49-6133/925152
> ---
>
>



RE: Embperl [- -] annoyance

1999-11-09 Thread Gerald Richter

>
> Auto-generated mathematica output... People who choose to put optional
> information within a document inside of brackets... I have hundreds of
> examples here on our site  (http://www.research.att.com/) where
> we've bumped
> up against the use of square brackets followed by one of the key
> characters
> used for purposes not intended to be Embperl...
>

ok, that's true. In my last mail I only thought of the ending and therfore
on Perl construct that leads to problems, but output from other programs
still is able to break Embperl, that's true.

Gerald

---
Gerald Richter  ecos electronic communication services gmbh
Internet - Infodatenbanken - Apache - Perl - mod_perl - Embperl

E-Mail: [EMAIL PROTECTED] Tel:+49-6133/925151
WWW:http://www.ecos.de  Fax:+49-6133/925152
---




Re: Embperl [- -] annoyance

1999-11-09 Thread Cliff Rayman

embperl escape character?

okay I'm reaching here.  something like

]] to indicate - ignore the next embperl character.  so something ugly like

[- $testdata=~m![^]]-]+!; -]

could work.  but you're right the \55 is much cleaner and easier to read.

cliff rayman
genwax.com

Gerald Richter wrote:

> > here's a suggestion - although I did not try it.
> >
> > [! $expr="[^-]+"; !]
> > [- $testdata=~m!$expr!go; -]
> >
>
> I also didn't tried it, but it should work this way.
>
> > if not - probably can work around it by placing this code in
> > a separate module and calling it with embperl.
> >
>
> Would work also, but seems too complicated to me.
>
> > looks like we need some kind of embperl escape character.
>
> What do you mean by "embperl escape character"?
>
> > no matter what you choose for embperl delimiters it can be broken
> > somewhere.
> >
>
> Yes.
>
> The simplest solution I see for now, is what David posted in his first mail:
>
> /...[^\55]+.../
>
> use \55 instead of -
>
> Gerald
>
> ---
> Gerald Richter  ecos electronic communication services gmbh
> Internet - Infodatenbanken - Apache - Perl - mod_perl - Embperl
>
> E-Mail: [EMAIL PROTECTED] Tel:+49-6133/925151
> WWW:http://www.ecos.de  Fax:+49-6133/925152
> ---



Re: Embperl [- -] annoyance

1999-11-09 Thread Frank D. Cringle

David Bushong <[EMAIL PROTECTED]> writes:
> A few times in the past months (I've been playing with Embperl a
> lot, it's a hell of a lot more fun than JSP, straight CGI, or
>  HTML::Template),

I have been trying to resist asking this, but it's no use:
why ?

[ I'm a recent convert to HTML::Template ].

-- 
Frank Cringle,  [EMAIL PROTECTED]
voice: (+49 2304) 467101; fax: 943357



RE: Embperl [- -] annoyance

1999-11-09 Thread David Emery

At 19:53 +0100 99.11.9, Gerald Richter wrote:
> >
> > This would be taken care of if the delimiters for Embperl tags weren't so
> > common in everyday use.
> 
> Sorry, but in my "everyday use" they are not so common. The only case I know
> where it occur, is the regex that David and Steve described. Are you know
> other cases, where this will be a problem?
> 

Pages containing Japanese text in sjis encoding are another example where the Embperl 
delimeters wreak havok. 

I think making them definable is much a much better solution than trying to find one 
set of delimeters that will work in every situation.

Dave 



Re: Embperl [- -] annoyance

1999-11-10 Thread G.Richter



> embperl escape character?
>
> okay I'm reaching here.  something like
>
> ]] to indicate - ignore the next embperl character.  so something ugly
like
>
> [- $testdata=~m![^]]-]+!; -]
>
> could work.  but you're right the \55 is much cleaner and easier to read.
>

There is an escape for the start of an Embperl block

[[-  -]

will not be interpreted by Embperl, just displayed as

[-  -]


Theres is nothing comparable for the end of the block, like you describe
above

Gerald





RE: EMBPERL ENQUIRY

1999-11-11 Thread Gerald Richter

I forward this to the modperl mailing list maybe somebody there could give
you an hint, or point you an url where you can find the requested
information. At least I can say, what you like todo is possible with Perl,
Embperl (and maybe modperl), but I can't give you more introduction then you
find on http://perl.apache.org/embperl, you may also check out
http://perl.apache.org/

Gerald

---
Gerald Richter  ecos electronic communication services gmbh
Internet - Infodatenbanken - Apache - Perl - mod_perl - Embperl

E-Mail: [EMAIL PROTECTED] Tel:+49-6133/925151
WWW:http://www.ecos.de  Fax:+49-6133/925152
---


> -Original Message-
> From: Kemi Odu [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, November 11, 1999 4:48 PM
> To: '[EMAIL PROTECTED]'
> Subject: EMBPERL ENQUIRY
> Importance: High
>
>
> Dear Mr G.Richter,
>
> Please kindly provide some insight into the best way to go in the
> development of an intranet that I am currently undertaking. I have read
> many documentation on PERL and I am not so sure on the best way to go. On
> further investigation I came across your web site and read about
> Embperl -
> Embed Perl in Your HTML Documents,  which I am excited about.
> Let me put you in the project picture. Basically, I have written my web
> front pages in HTML and the Database in Access 97. I now have to connect
> the two together for tasks like UserID and password validation;
> Retrieving/displaying Addresses using various search criteria; Performing
> Keyword Searches and displaying the result etc.
>
> I thought that what I needed was just the PERL program; DBI;
> DBD:ODBC. But
> I now realise that I have to make the images on the HTML pages to accept
> Events (Click, Menu Selection)  which would be run as PERL scripts upon
> triggering, I suppose that I would have to write PERL scripts
> with the HTML
> scripts.
>
> Please advise me on the ALL the development tools/resources I
> need and how
> Embperl fits in.
>
> I look forward to your prompt reply and thanks you in advance for your
> assistance.
>
> Best Regards,
> Kemi Odu
> mailto:[EMAIL PROTECTED]
>
>



Re: EmbPerl, PHP

1999-11-22 Thread Ken Y. Clark

On Mon, 22 Nov 1999, Robert Locke wrote:

> 
> Hi,
> 
> Can anyone point me towards any good resources comparing EmbPerl, PHP,
> etc.?
> 
> Or better yet, does anyone have any real world stories about the
> merits of each in terms of performance, memory consumption, bugs, etc?
> 
> On an unrelated note, any recommendations for a plotting package to
> generate dynamic bar/line graphs and pie charts?  I found one called
> VH Graph (commercial) for PHP that seemed pretty cool in case anyone's
> interested:
>   http://www.vhconsultants.com/graph2.htm
> 
> Thanks!
> 
> Rob

we've used gnuplot and GIFgraph very successfully.  GIFgraph was a lot
easier.

ky



RE: EmbPerl, PHP

1999-11-22 Thread Gerald Richter

>
> Can anyone point me towards any good resources comparing EmbPerl, PHP,
> etc.?
>
> Or better yet, does anyone have any real world stories about the
> merits of each in terms of performance, memory consumption, bugs, etc?
>

Steve Willer has written a few words about PHP and Embperl. Look at

http://perl.apache.org/embperl/Sites.pod.1.html#http_www_webpersonals_com_St

there are also other stories about Embperl. The main decision I think is, if
you want to use perl (which you can also use in non Web contextes) or you
want to use PHP's own language.

Gerald

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

Post:   Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925151
WWW:http://www.ecos.de  Fax:  +49 6133 925152
-



RE: EmbPerl, PHP

1999-11-22 Thread Gerald Richter

>
> > Steve Willer has written a few words about PHP and Embperl. Look at
> >
> >
> http://perl.apache.org/embperl/Sites.pod.1.html#http_www_webperson
> als_com_St
>
> Well, the 10-20 times performance difference is very
> questionable.  Depends a lot on what you are doing.  For most stuff PHP is
> about 30% slower than static pages on a site.  So for anything to be even
> twice as fast as PHP it has to be faster than static pages.
>

I can't comment on that, because I am not using PHP, but Embperl is surely
slower than static pages. It has about the same speed, then writing the same
application with a normal Perlscript that runs under mod_perl and
Apache::Registry.

Gerald

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

Post:   Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925151
WWW:http://www.ecos.de  Fax:  +49 6133 925152
-



RE: EmbPerl, PHP

1999-11-23 Thread Rasmus Lerdorf

> Steve Willer has written a few words about PHP and Embperl. Look at
> 
> http://perl.apache.org/embperl/Sites.pod.1.html#http_www_webpersonals_com_St

Well, the 10-20 times performance difference is very
questionable.  Depends a lot on what you are doing.  For most stuff PHP is
about 30% slower than static pages on a site.  So for anything to be even
twice as fast as PHP it has to be faster than static pages.

> there are also other stories about Embperl. The main decision I think is, if
> you want to use perl (which you can also use in non Web contextes) or you
> want to use PHP's own language.

Although PHP is specifically geared to be a web scripting language it
actually does work as a standalone language and can be put right alongside
perl in /usr/local/bin on your system.  Plenty of people do this, although
personally I would rather use Perl for non-web stuff.

-Rasmus



RE: Embperl Subroutines

1999-11-23 Thread Gerald Richter

>
> One thing that I am doing now is making use of Embperl [$ sub $] [$
> endsub $] for defining subroutines. If I read the documentation
> correctly these subroutines will be 'imported' into any page that I
> import them into. I see no mention of reuse of these subroutines, each
> page seems to get it's own compiled copy in it's namespace.
>

No, the subroutines are compiled in one package, and only the names are
imported in each page from which you call Execute with the import parameter.
So the subroutines get resued. It's just the same as Perl's "use".

> I am wondering if during the Execute I can set the PACKAGE that the
> subroutines are compiled into like:
>
>  Execute( { inputfile => '/include/subs.emb', package => 'Subs', import
> => 1 } );
>
> and then use
>
>  [- Subs::subroutine -]
>
> in my pages.
>
> I could run this once in my startup.pl, pre-compile the subroutines and
> reuse them.
>
You can do so. Use import => 0, to only compile your subroutines and not
import the names in the namespace of your startup.pl:

  Execute( { inputfile => '/include/subs.emb', package => 'Subs', import =>
0 } );

Gerald

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

Post:   Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925151
WWW:http://www.ecos.de  Fax:  +49 6133 925152
-




RE: Embperl Emergency!!!

2000-01-12 Thread Gerald Richter

 Hi,
>
> I just upgraded to Embperl 1.2.1 and I've broken my internet server!$%
>
> It appears the problem is I have some perl routines that go
> print < 
> EOF
>

>From which version did you upgrade? This problem should also be there for
all older versions I remember...

> etc.. That was probably the wrong thing to do. I think the HTML is
> coming out before the http headers. Well I've tried the
> $optRedirectStdout feature but all the HTML is quoted so I get
>  etc which is no good. I've tried $optDisableHtmlScan, but
> that doesn't help.
>
> I've tried to print to OUT instead of STDOUT, but OUT doesn't seem to be
> in the right namespace (No, I'm not a perl guru). And I've tried to pass
> the OUT descriptor to the routine using \*OUT or *OUT{IO}, but none of
> this works.
>

Try


{
local $HTML::Embperl::escmode = 0 ;
print HTML::Embperl::OUT <
EOF
}

This should work, but it's just a quick hack. I do not promise that Embperl
1.4 or 2.0 will support these global variables, also I guess they will do
so. (1.3 surely will not change these things)

Gerald

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

Post:   Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925151
WWW:http://www.ecos.de  Fax:  +49 6133 925152
-




Re: Embperl emergency

2000-01-12 Thread Sean Chittenden

print qq(Using qq() works remarkably well and preserves newlines,
tabs, etc.  Here docs are... legacy, in my mind and are less friendly to
editors (such as emacs).  See if moving to qq() solves your problems, if
not, then ... I dunno.);

This is more along the lines of a PS than anything else, but it
works for all interpolated envs in perl.  Ex:

print qq(the result of 1 + 1 = @{[1 + 1]}\n);

Inline code evaluation w/in a string...  combine this w/ the
ternery operator ((EXPR) ? (TRUE) : (FALSE)) and you've got a pretty
inline scripting tool that's not emb perl.  The only gotcha is that you
can't have multiple statements (ex:  @{[ EXPR; EXPR2; EXPR3 ]}).  That
should turn up an error.  Anyway, fyi.

--SC

-- 
Sean Chittenden  <[EMAIL PROTECTED]>

My CODE of ETHICS is vacationing at famed SCHROON LAKE in upstate New
York!!

On Thu, 13 Jan 2000, Chris wrote:

> Date: Thu, 13 Jan 2000 07:55:36 +1100
> From: Chris <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED],
>  [EMAIL PROTECTED], [EMAIL PROTECTED]
> Subject: Embperl emergency
> 
> 
> Hi,
> 
> I've just upgraded to Embperl 1.2.1 and I've stuffed my webserver. It
> appears the problem is that I've been writing code like this..
> print < 
> EOF
> 
> This used to work, but I guess it's wrong. I've tried $optRedirectStdout
> but it quotes everything...
>  which is not what I want.
> I've tried $optDisableHtmlScan, but that doesn't seem to help in this
> case.
> 
> The code in question is in another perl module that doesn't seem to have
> access to OUT, so I can't print to that. I've tried passing OUT as a
> parameter to the subroutine (\*OUT or *OUT{IO}) but I can't seem to get
> the syntax right or something because it just complains that $OUT is
> undefined.
> 
> Can someone help get my webserver back on line!?
> 
> Thanks,
> 
> Chris Bitmead
> mailto:[EMAIL PROTECTED]
> 



Re: Embperl emergency...

2000-01-13 Thread Gerald Richter

>
> The $escmode thing doesn't seem to work for me. In my srm.conf I have
> optRedirectStdout set. My embperl code looks a bit like this...
>
> [- use foo; -]
> [- $escmode = 1; -]

You need to set to to zero!

> [- foo->bar() -]
>
> And inside foo.pm
>
> bar() {
> print < 
> EOF
> }
>
> I've used $escmode before inside regular embperl successfully, but it
> doesn't seem to be doing for me in this case. I also tried the full name
> of escmode (HTML::escmode or whatever it is Gerald suggested. Don't have
> it in front of me now).
>
> I was using 1.2.0b5 I believe, and it all seemed to work. Now the html
> comes out before the http headers unless I set optRedirectStdout.
>

There was no change in this behaviour. That buffering of the output (which
causes your problem), is introduced somewhere in 0.1x (3 years ago :-)

Anyway if it works, like you write in your other mail, then everything is
fine :-)

Gerald





RE: Embperl optEarlyHttpHeader

2000-01-18 Thread Gerald Richter

Hi,
> if I set optEarlyHttpHeader (64) within my EMBPERL_OPTIONS my
> page ist correctly shown in the browser. But if
> optEarlyHttpHeader is not set, the contents of my page are mixed
> up. I use several blocks of [- -] and [* *] and I execute two
> Shellscripts using perls backtick-syntax (unfortunately I cannot
> avoid this due to backward compatibility with other pages, those
> scripts do some layout stuff). The different blocks of my page
> get reordered and in between I see the HTTP-Headers.
>
> Can I avoid this reordering and ensure a correct display of my
> page without having to do a major rewrite?
>

Without optEarlyHttpHeader Embperl is buffering your output and if anything
is ok sends the headers and afterwards the content of the page. If you print
directly to STDOUT, this will send directly to the browser and not buffered
by Embperl, so it will be shown up before the http headers. You can use the
optRedirectStdout to also buffer normal output to Perl's STDOUT, but this
will not affect shell scripts.

If you want to buffer the shell script output, you need to read the output
and output it afterwards:

[+

local $/= undef ;
open FH, "foo.sh|" ;
$out =  ;
close FH ;

$out ;
+]

Gerald

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

Post:   Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925151
WWW:http://www.ecos.de  Fax:  +49 6133 925152
-



RE: Embperl struggles

2000-06-02 Thread Greg Estep


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 


-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++





Re: Embperl struggles

2000-06-03 Thread Toni Mueller



Hello all,

On Fri, Jun 02, 2000 at 04:17:38PM +0200, Toni Mueller wrote:
> trying to develop with Embperl I encounter the following
> problems:
> [ stuff deleted ]

before reading _all_ your kind answers gently pushing me
in the right direction I wanted to thank you for that and
excuse myself for bothering you ...

The short answer to most if not all of these problems is
that after reading the manuals, I should re-read them twice,
AND WHEN BEING AWAKE :-( (slap on my back)


Best Regards,
--Toni++




RE: Embperl struggles

2000-06-04 Thread Gerald Richter

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

I append you a mail I write last month that should explain what happens...

> 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.
>

Don't use [*  *] (only if you need recursions), because it is still
experminetal in the current version and has some problems. Use  [!  !] to
define Perl-subroutines, in all other cases use [- -].

For scoping read:

http://perl.apache.org/embperl/Embperl.pod.5.html#Variable_scope_and_cleanup


> 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).
>

I don't use Emacs, so I can't help you on this issuse, but I am happy to put
anything up on the web, if available.

Gerald

P.S. Support for Embperl is now on the Embperl Mailing list
([EMAIL PROTECTED])

> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of
> Gerald Richter
> Sent: Friday, April 21, 2000 9:10 PM
> To: Ulrike Schepp; Steven D. Arnold
> Cc: Embperl Mailingliste
> Subject: RE: use module in Embperl (was: problem solved, but still
> weird!)
>
>
> >
> > Standard workaround here is now "apachectl restart" after the change of
> > modules :-/ weird but it really works!
> >
>
> Nothing weird here. Everything is well defined. Just let us try to
> understand how Perl, mod_perl and Embperl works together:
>
> "perldoc -f use" tells us:
>
>   Imports some semantics into the current package from the named module,
>   generally by aliasing certain subroutine or variable names into your
>   package.  It is exactly equivalent to
>
>  BEGIN { require Module; import Module LIST; }
>
>   except that Module must be a bareword.
>
> So what's important here for us is, that use executes a require
> and this is
> always done before any other code is executed.
>
> "perldoc -f require" says (among other things):
>
>   ..., demands that a library file be included if it hasn't already
>   been included.
>
> and
>
>   Note that the file will not be included twice under the same specified
>   name.
>
> So now we know (or should know) that mod_perl starts the Perl interpreter
> once when Apache is started and the Perl interpreter is only
> terminated when
> Apache is terminated. Out of these two things follows, that a
> module that is
> loaded via use or require is only loaded once and will never be reloaded,
> regardless if the source changes or not.
>
> So far this is just standard Perl. Things get's a little bit more
> difficult
> when running under mod_perl (only Unix), because Apache forks a
> set of child
> processes as neccessary and from the moment they are forked, they run on
> their own and don't know of each other. So if a module is loaded at server
> startup time (before the fork), it is loaded in all childs (this
> can be used
> to save memory, because the code will actually only reside once
> in memory),
> but when the modul is loaded inside the child and the source changes, it
> could be happen, that one child has loaded an ealier version and another
> child has loaded a later version of that module, depending on the time the
> module is actualy loaded by the child.
>
> That explains, why sometimes it works and sometimes it doesn't, simply
> because different childs has loaded different versions of the same module
> and when you reload your page you hit different childs of Apache!
>
> Now there is one point that is special to Embperl to add. Since Embperl
> compiles every page in a different namespace, a module that
> doesn't contains
> a "package foo" statement is compiled in the namespace of the
> page where it
> is first loaded. Because Perl will not load the module a second
> time, every
> other page will not see subs and vars that are defined in the
> loaded module.
> This could be simply avoided by giving every module that should be loaded
> via use/require an explicit namespace via the package statement.
>
> So what can we do?
> - If a module change, simply restart Apache. That's works always.
> - use Apache::StatInc. This will do a stat on every loaded module and
> compare the modification time. If the source has changed the module is
> reloaded. This works most times (but not all modules can be cleanly
> reloaded) and as the number of loaded modules increase, your
> sever will slow
> down, because of the stat it has to do for every module.
> - Use "do" instead of "require". do will execute your file everytime it is
> used. This also adds overhead, but this may be accpetable for
> small files or
> in a debugging environement. (NOTE: Be sure to check $@ after a
> do, because
> do works li

Re: Embperl [$ sub $] question

1999-10-19 Thread Cliff Rayman

I use it all the time to define subroutines.
They do not return values the way normal subroutines do however.
Perhaps Gerald needs to modify the documentation to reflect his.

cliff rayman
genwax.com

Jason Bodnar wrote:

> Can the new sub meta-command not be used to define functions?
>
> I tried:
>
> [$ sub foo $]
>  [+ shift +]
> [$ endsub $]
> [+ sub("bar") +]
>
> and got 0.
> ---
> Jason Bodnar + [EMAIL PROTECTED] + Tivoli Systems
>
> That boy doesn't know the difference between the Internet and a hair net. --
> Jason Bodnar



Re: Embperl [$ sub $] question

1999-10-19 Thread Robert

It should be [- foo("bar") -]

- Robert

Jason Bodnar wrote:

> Can the new sub meta-command not be used to define functions?
>
> I tried:
>
> [$ sub foo $]
>  [+ shift +]
> [$ endsub $]
> [+ sub("bar") +]
>
> and got 0.
> ---
> Jason Bodnar + [EMAIL PROTECTED] + Tivoli Systems
>
> That boy doesn't know the difference between the Internet and a hair net. --
> Jason Bodnar



Re: Embperl [$ sub $] question

1999-10-20 Thread Jason Bodnar

Right, which is the problem. Well, not necessarily a bug but just a feature
that's lacking.

On 20-Oct-99 Robert wrote:
> It should be [- foo("bar") -]
> 
> - Robert
> 
> Jason Bodnar wrote:
> 
>> Can the new sub meta-command not be used to define functions?
>>
>> I tried:
>>
>> [$ sub foo $]
>>  [+ shift +]
>> [$ endsub $]
>> [+ sub("bar") +]
>>
>> and got 0.
>> ---
>> Jason Bodnar + [EMAIL PROTECTED] + Tivoli Systems
>>
>> That boy doesn't know the difference between the Internet and a hair net. --
>> Jason Bodnar

---
Jason Bodnar + [EMAIL PROTECTED] + Tivoli Systems

I swear, sometimes I'd forget my own head if it wasn't up my ass. -- Jason
Bodnar



RE: embperl & plain text

1999-10-28 Thread Gerald Richter

Hi Gary,
>
> I just noticed that you had in fact made an optSaveSpaces in 1.2b10.
> Thanks!  I had tried to access your CVS stuff via the two methods you
> mentioned, couldn't get it working, and more or less gave up until
> I could figure out what I was doing wrong... didn't want to bug you
> until I knew for sure where the problem was.
>

The anoncvs does not work as mentioned in ealier version of CVS.pod, you may
browse the the Embperl CVS via
http://www.apache.org/websrc/cvsweb.cgi/embperl/ or download a shnapshot at
http://dev.apache.org/from-cvs/embperl/ . The cvsup method should also work,
I just tested it again and it does it job fine :-)





> You'll be (less than) pleased to know I managed to SEGV HTML::Embperl
> today (in normal usage, not mod_perl).  It's in cleanup, and I'm trying
> to get the $HTML::Embperl::dbgShowCleanup variable to do what I think
> it should so I can see what's happening.  No luck yet but... oh, it
> runs fine when the script is run as a normal user, but when run under
> BSDI as the same user but with a forced 'login class' (with any luck
> you've never had to deal with _that_ little nightmare...),

I don't even know what a 'login class' is...

> it SEGV's!

Could you try to get a stackbacktrace? (Look in the Faq for more info how to
do it)

Gerald


---
Gerald Richter  ecos electronic communication services gmbh
Internet - Infodatenbanken - Apache - Perl - mod_perl - Embperl

E-Mail: [EMAIL PROTECTED] Tel:+49-6133/925151
WWW:http://www.ecos.de  Fax:+49-6133/925152
---



RE: embperl & plain text

1999-10-29 Thread Gary Shea

Hey Gerald --

I just noticed that you had in fact made an optSaveSpaces in 1.2b10.
Thanks!  I had tried to access your CVS stuff via the two methods you
mentioned, couldn't get it working, and more or less gave up until
I could figure out what I was doing wrong... didn't want to bug you
until I knew for sure where the problem was.

You'll be (less than) pleased to know I managed to SEGV HTML::Embperl
today (in normal usage, not mod_perl).  It's in cleanup, and I'm trying
to get the $HTML::Embperl::dbgShowCleanup variable to do what I think
it should so I can see what's happening.  No luck yet but... oh, it
runs fine when the script is run as a normal user, but when run under
BSDI as the same user but with a forced 'login class' (with any luck
you've never had to deal with _that_ little nightmare...), it SEGV's!
Amazing.

More later...

Gary

On Thu, 17 Jun 1999, Gerald Richter wrote:
> Hi,
> 
> in epmain.c about line 764 is the following code:
> 
> 
> /* skip trailing whitespaces */
> while (isspace(*pAfterWS))
> pAfterWS++ ;
> 
> if (nType == '+' && pAfterWS > p)
> pAfterWS-- ;
> 
> 
> if you delete these lines, whitespace shouldn't change. Let me know if it
> works and I make it an option in the next release
> 
> Gerald
> 
> 
> 
> ---
> Gerald Richter
> ECOS  Electronic Communication Services
> Internet - Faxabruf - Infodatenbanken
> 
> E-Mail: [EMAIL PROTECTED]
> WWW:http://www.ecos.de
> Tel:+49-6133/925151
> Fax:+49-6133/925152
> Faxabruf:   +49-6133/93910100
> 
> 
> > -Original Message-
> > From: Gary Shea [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, June 16, 1999 11:07 PM
> > To: [EMAIL PROTECTED]
> > Subject: embperl & plain text
> >
> >
> > Hi, I've been using Embperl with excellent results for some time
> > now, but recently ran into something I haven't been able to figure
> > out.  I use Embperl in a system where it generates both web pages
> > and email messages in plain text.  The web pages work great.
> > Using it to format email messages is, I know, not exactly what
> > you had in mind (it's not HTML!), but my only alternative is
> > to go back to my home-brewed pre-Embperl code, which frankly isn't
> > as nice as Embperl, or to use ePerl, which I'm not that
> > excited about.
> >
> > My problem is that Embperl seems to play fast and loose as far
> > as removing and adding white space.  A page which is composed
> > of text, simple variable substitutions, and substitutions which
> > are the results of previous Embperl substitutions, shows almost
> > (I say almost 'cause it's a computer after all...) random
> > additions of leading and trailing white space, and seemingly
> > random subtractions of blank lines.  Does this seem possible?
> > I am pretty convinced it is really happening...
> >
> > I understand that an HTML-specific tool has no need to respect
> > white space, but I was hoping that it might be straightforward to get
> > Embperl to respect white space.
> >
> > Here's an example of a typical call to Embperl where the problem
> > shows up.
> >
> > require HTML::Embperl;
> >
> > my $line;
> > HTML::Embperl::Execute ({
> > 'debug' => 0,
> > 'escmode' => 0,
> > 'inputfile' => $tpl,
> > 'options' =>
> > HTML::Embperl::optDisableChdir ()
> > | HTML::Embperl::optDisableEmbperlErrorPage ()
> > | HTML::Embperl::optDisableFormData ()
> > | HTML::Embperl::optDisableHtmlScan ()
> > | HTML::Embperl::optRawInput (),
> > 'output' => \$line,
> > 'param' => $pairs,
> > });
> > $line =~ s/^\s*//;
> > $line =~ s/\s*$//;
> >
> > The s/// stuff is there to get rid of random added leading/trailing
> > white space.  But the funniest part is that this exact same piece of code,
> > on a different template, will somehow remove ALL blank lines from
> > the code!  Except one.  Weird!
> >
> > I'm beginning to dig through the code now, but hints would be welcome...
> >
> > Thanks!
> >
> > Gary
> >
> 
> 

-
Gary Shea   [EMAIL PROTECTED]
Salt Lake City  http://www.xmission.com/~shea



RE: Embperl: Installation woes

1999-10-31 Thread Gerald Richter

> 
> The following error msg appears while trying to install.
> 
> upload.htmERR:Internal Server Error
> Input:  ./test/html/upload.htm
> Output: ./test/tmp/out.htm
> Compared to:./test/cmp/post.htm
> Log:./test/tmp/test.log
> 
> ERRORS detected! NOT all test have been passed successfully
> 
> 
> Found unexpected output in httpd errorlog:
> [Sun Oct 31 19:39:56 1999] [error] require CGI failed: Insecure 
> dependency 
> in require while running with -T switch at (eval 467) line 3.
> 


Upgrade CGI.pm to a newer version and the error will disapear

Gerald




Re: embperl - EMBPERL_MAIL_ERRORS_TO - trigger

1999-11-02 Thread Gerald Richter


>
> I would like to be able to trigger an "error" so that the log section
> associated with that embperl session gets mailed to me when
> that session closes.
>
> This is for errors in my logic or processing problems which are not
> fatal enough to cause embperl to fail on its own.
>


You can trigger an "error" with "die", but I am not sure if this is what you
want...

The EMBPERL_MAIL_ERRORS_TO will mail you some information about the request
(%fdat, %udat, %ENV, @errors), but not the logfile.

Gerald



---
Gerald Richter  ecos electronic communication services gmbh
Internet - Infodatenbanken - Apache - Perl - mod_perl - Embperl

E-Mail: [EMAIL PROTECTED] Tel:+49-6133/925151
WWW:http://www.ecos.de  Fax:+49-6133/925152
---




RE: Embperl - Apache redirect

1999-01-02 Thread Gerald Richter

>
> Should there by any difference between using?:
>
> [-
>pcsuri($_[0]), $rdrloc=$GWCe::pcsuri;
>use Apache;
>use Apache::Constants qw(REDIRECT);
>$req_rec->header_out("Location" => $rdrloc);
>$req_rec->status(REDIRECT);
>exit;
> -]
>
> and:
>
> [-
>pcsuri($_[0]), $rdrloc=$GWCe::pcsuri;
>$http_headers_out{'Location'} = $rdrloc;
>exit;
> -]
>
>
> I was having an intermittant problem with my redirects until I started
> using the new http_headers_out directive.
> The redirect was not being sent to the browser.  It could be I had
> another error somewhere, but just wanted to report it to the list in
> case someone else notices an issue using Apache redirect inside of
> Embperl.
>

Both version should do the same thing! (Version one will return status 302,
while version two uses 301, but the result is the same) I am using the first
version in a lot of places, whithout problems...

I just copied your two pieces of code in two files, to make sure nothing is
broken, and both work without problems :-)

Gerald



RE: EMBPERL: Possible bug

1999-11-10 Thread Gerald Richter

> We are running a lot of embperl stuff and are running into a rather
> unsual problem when data is entered into a form with
> 00 (zero-zero) endings including 300, 400, etc.
>
> Has anyone seen a bug of this sort?
>

I don't had ever has problems with form fields where 300 or 400 is entered.
Can you give more deatils (source, error message, what happening if you
enter 300)?

Gerald

---
Gerald Richter  ecos electronic communication services gmbh
Internet - Infodatenbanken - Apache - Perl - mod_perl - Embperl

E-Mail: [EMAIL PROTECTED] Tel:+49-6133/925151
WWW:http://www.ecos.de  Fax:+49-6133/925152
---




Re: EmbPerl, PHP continued...

1999-11-23 Thread Rasmus Lerdorf

> RESULTS:
> 
> - Results are "Requests per second".  I'm not sure how to
>   interpret the numbers on an absolute scale, but the relative
>   comparisons should be somewhat meaningful.
> 
> - Each test was conducted 5 times and the average is shown.
> 
> - "ab" was used from the same machine as the web servers because
>   something "strange" happened when I ran it on another machine.
>   (I'll send a separate email regarding this.)
> 
> 
>1000 requests, 1 concurrent
>   ab -n 1000 -c 1 
>   --
>   Test1  Test1(b) Test2 Test3Test4Test5
> ---
> Apache w/ 
> modperl/  852.86 99.53217.2516.9678.1218.32
> EmbPerl  
>   
> Apache w/ 836.47100.06560.7816.1598.7618.80
> PHP  
> 
> AOLServer 100.01 99.72100.0612.89   156.3014.29
> 
>   
> 
>1000 requests, 10 concurrent
>   ab -n 1000 -c 10 
>   --
> 
>   Test1 Test1(b)  Test2 Test3Test4 Test5
> 
> Apache w/ 
> modperl/  890.37248.00262.4730.31158.5045.17
> EmbPerl   
> 
> Apache w/ 957.30492.55559.7123.81268.3434.64
> PHP  
> 
> AOLServer 758.54227.76816.65 5.97141.19 7.45

Well, I think it shows nicely that mod_perl-EmbPerl and PHP are in the
same ballpark.  This has always been my impression as well.  PHP tends to
be quicker on short simple scripts which your results also show while PHP
3 was not very efficient at handling large loops.  This is reflected in
your Test 3/5 numbers there where PHP is a little bit slower.  But,
certainly not by a factor of 10-20 as some people like to say.  And this
looping deficiency has been fixed in PHP 4.  PHP 4 also brings an optional
interpreted script cache along with an optimizer which can help out with
really complex and time-consuming scripts.

By the way, PHP 4 also works as a module in aolserver now (Zeus coming 
soon).  Would be interesting to see if PHP could beat aolserver's built-in
tcl engine.

One thing that might be interesting to see would be the peak memory and
cpu usage for each one.  That would give some indication of scaleability
issues.  I have no idea how PHP will fare here.  ;)  Some improvements
were made in PHP 4 in this respect though.

-Rasmus



RE: Embperl and printing...

1999-12-02 Thread Gerald Richter

>
> I have a binary string that I would like to print, but it
> includes the EOF
> character ("\0").
>
> Embperl seems to cut off the string at the first terminator, whether I do:
> [+ $string +]
> or  [- print OUT $string -]
>
> However, if I print the string to a regular file, the whole string prints
> without any problems.
>
> Am I doing something wrong?  How do I print the whole string and
> nothing but
> the string?  :)
>

This maybe true, I never tried this, because the \0 is the normal string
terminating charater in C.

The only solution I see, to set the optEarlyHttpHeader option in your
httpd.conf, then you can use the normal Perl print, which should work with
binary data as well.

Gerald

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

Post:   Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925151
WWW:http://www.ecos.de  Fax:  +49 6133 925152
-



RE: Embperl with DSO

1999-12-02 Thread Gerald Richter

> I went ahead and compiled my own Apache and mod_perl for Red Hat, but
> was curious if there is a solution for using Embperl with DSO and
> allowing for the modules to be loaded one time.
>
> I thought I had the above working with the default Red Hat 6.0
> Apache/mod_perl, but it was not "permanently" loading the modules. When
> I removed refernece to HTML::Embperl from my startup.pl file I got:
> Undefined subroutine &HTML::Embperl::handler called
>
> Mine is working now, just curious if there is something I could have
> done to keep from compiling my own. (one less step in new server setup
> and testing)
>

Using Perl module with XS code in a DSO mod_perl, still causes weired
results (see my other mail about DBI). The reason (in short) is that Apache
loads mod_perl, unloads it and loads it a second time, but the dynamic
libraries that are loaded for the XS code, don't get unloaded after the
first load. That causes strange results and could be only avoided if the XS
code libraries _not_ loaded at server startup time. If have created a
workaround (compile mod_perl with PERL_STARTUP_DONE_CHECK=1), this works at
least on NT, but seems not to work in all cases on Unix. Hopefully sometime
I will have some more time to debug this and create a real solution.

Gerald



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

Post:   Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925151
WWW:http://www.ecos.de  Fax:  +49 6133 925152
-



RE: Embperl MailFormTo Bug

1999-12-15 Thread Gerald Richter

>
> A colegue of mine has found the following with the MailFormTo Embperl
> function:
>

A know this problem and it's already on the todo list (should have been
fixed in 1.2.0 already, but it's somehow undergone, sorry)

Thanks for the hint, anyway

Gerald



RE: [Embperl] Execute failing

1999-12-22 Thread Gerald Richter

Hi,

> 
> I can point out that I'm using Execute in the short format, except
> in one place, where I'm using the long format to set the import flag to
> 1. And its on those particular files where all my Execute(s) fail, when
> only the second Execute carries the import flag.
> 
> weird.
> 
Could you send me an example how the call to Execute that fails looks like?

Is there anything in the Apache error.log what maybe helpfull?

Gerald



RE: Embperl under cgiwraper

2000-01-06 Thread Gerald Richter

Hello,

>In my system, cgiwraper is installed and is used as wraper for all .pl and
.cgi scripts.
>I tried to install embperl without any success. Everytime I get the error
cgiwraper not
>found for embperl.


I don't know much about cgiwrapper, so could you give me some more details,
what it does and how it works? Then we could try to figure out what's the
problem with Embperl and cgiwrapper.

Gerald

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

Post:   Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925151
WWW:http://www.ecos.de  Fax:  +49 6133 925152
-



RE: Embperl under cgiwraper

2000-01-07 Thread Gerald Richter

>
> unshift(@INC, '/home/sites/home/HTML-Embperl-1.2.0/blib/lib' );
> print "@INC\n";
>

You don't need this, if you have run "make install"


>
> [11765]ERR:  30: Line 1: Not found ?

This error message comes from Embperl. So the embpcgi.pl is still found,
otherwise you wouldn't see this message, but Embperl didn't a/the file which
should be processed. From the error message it seems you didn't give Embperl
any sourcefile to process.


You must request it like this:

http://localhost/cgi-bin/embpcgi.pl/path/to/the/source.html

where /path/to/the/source.html is your source file, that means, if you
request only

http://localhost/path/to/the/source.html

you should simply see your raw source.


Hope this helps

Gerald



Re: Embperl under cgiwraper

2000-01-07 Thread Vijay

Hello,

I have setup srm.conf as given below.


Action text/html /scripts/embpcgi.pl


I believe that by default all html files under this directory should be
processed by embpcgi.pl. This is what is not happening.

I may have not set up properly. I have installed embperl without
support for mod_perl. I want to use it as CGI.

Thanks for all help.

Vijay Nair
- Original Message -
From: Gerald Richter <[EMAIL PROTECTED]>
To: Vijay <[EMAIL PROTECTED]>
Cc: mod_perl Maillinglist <[EMAIL PROTECTED]>
Sent: Friday, January 07, 2000 1:36 PM
Subject: RE: Embperl under cgiwraper


> >
> > unshift(@INC, '/home/sites/home/HTML-Embperl-1.2.0/blib/lib' );
> > print "@INC\n";
> >
>
> You don't need this, if you have run "make install"
>
>
> >
> > [11765]ERR:  30: Line 1: Not found ?
>
> This error message comes from Embperl. So the embpcgi.pl is still found,
> otherwise you wouldn't see this message, but Embperl didn't a/the file
which
> should be processed. From the error message it seems you didn't give
Embperl
> any sourcefile to process.
>
>
> You must request it like this:
>
> http://localhost/cgi-bin/embpcgi.pl/path/to/the/source.html
>
> where /path/to/the/source.html is your source file, that means, if you
> request only
>
> http://localhost/path/to/the/source.html
>
> you should simply see your raw source.
>
>
> Hope this helps
>
> Gerald
>



Re: Embperl + Apache::Session

2000-01-12 Thread Cliff Rayman

i am using embperl with cookies.
i also have this set in httpd.conf

PerlSetEnv EMBPERL_COOKIE_DOMAIN .genwax.com
PerlSetEnv EMBPERL_COOKIE_PATH /
PerlSetEnv EMBPERL_COOKIE_EXPIRES 'Friday, 31-Dec-2010 14:00:00 GMT'

how are you checking to make sure cookies are sent?
either telnet directly to the port and do a get

telnet www.domain.com 80
GET /path/to/page/with/embperl HTTP/1.0


that is two returns above,

or better

lwp-request -e 'http://www.domain.com/path/to/page/with/embperl|less

You should see a SET-COOKIE header.

cliff rayman
genwax.com

Andre Landwehr wrote:

> Hi,
> I am trying to use sessionmanagement via Apache::Session together
> with HTML::Embperl. As I understand from  the documentation I
> just need to configure a storing and a locking mechanism in
> httpd.conf to do so. After that I should be able to use the %udat
> hash to store session related data, HTML::Embperl::Session is
> supposed to do everything from creating a unique session-id to
> storing it in a cookie or retrieving that cookie again
> automatically.
> Unfortunately setting the cookie does not work for me. When I use
> %udat for the first time a session-id is created (which I checked
> with a simple "print %udat;"), but the cookie is not sent (and:
> yes, my Netscape is cookie-enabled...). This is the embperl
> related stuff from my httpd.conf:
>
> --
> AddType text/html .epl
> SetEnv EMBPERL_DEBUG 10477
> SetEnv EMBPERL_VIRTLOG /perldebug
> SetEnv EMBPERL_ESCMODE 0
> # optRawInput + optRedirectStdout
> SetEnv EMBPERL_OPTIONS 16914
>
> # Session management
> PerlSetEnv EMBPERL_SESSION_CLASSES "MemoryStore NullLocker"
> PerlModule HTML::Embperl
>
> 
> SetHandler perl-script
> PerlHandler HTML::Embperl
> Options ExecCGI
> 
> 
> SetHandler perl-script
> PerlHandler HTML::Embperl
> Options ExecCGI
> 
> ---
>
> I use the following versions:
> Apache_1.3.9
> Apache-Session-1.04
> HTML-Embperl-1.2.1
> libwww-perl-5.43
> URI-1.02
> HTML-Parser-2.23
>
> I would be happy if someone could help me with that since I have tried
> for two days everytime with the same result, which gets quite
> depressing by now ;-)
>
> Btw: To my mind Embperl is really great! I ported a site from PHP to
> Embperl recently and gained about 80% speed with that, due to
> faster database access
>
> Take care,
> Andre
>
>   
>Part 1.2Type: application/pgp-signature



Re: Embperl + Apache::Session

2000-01-13 Thread Andre Landwehr

On Wed, Jan 12, 2000 at 11:12:53AM -0800, Cliff Rayman wrote:
> i am using embperl with cookies.
> i also have this set in httpd.conf
> 
> PerlSetEnv EMBPERL_COOKIE_DOMAIN .genwax.com
> PerlSetEnv EMBPERL_COOKIE_PATH /
> PerlSetEnv EMBPERL_COOKIE_EXPIRES 'Friday, 31-Dec-2010 14:00:00 GMT'
> 
> how are you checking to make sure cookies are sent?
> 
> lwp-request -e 'http://www.domain.com/path/to/page/with/embperl|less
> 
> You should see a SET-COOKIE header.

I inserted those lines above into my httpd.conf, and did the
lwp-request. All headers I do see are the following:

Connection: close
Date: Thu, 13 Jan 2000 14:39:53 GMT
Server: Apache/1.3.9 (Unix) mod_perl/1.21 PHP/3.0.12
Content-Type: text/html
Client-Date: Thu, 13 Jan 2000 14:39:53 GMT
Client-Peer: 145.228.112.103:80
Title: sessiontest 1


Can you please send me a simple testpage for this, maybe I do
something wrong in my embperl code... I have only begun with perl
6 weeks ago or so and I still have not understood all mystiques
;-)

Take care,
Andre



Re: Embperl + Apache::Session

2000-01-13 Thread Cliff Rayman

how about trying something simple like.



testing

This is my counter:
[+ $udat{COUNTER}++ +]




use your browser to view the page.
keep hitting reload - counter should increase.

cliff rayman
genwax.com

Andre Landwehr wrote:

> On Wed, Jan 12, 2000 at 11:12:53AM -0800, Cliff Rayman wrote:
> > i am using embperl with cookies.
> > i also have this set in httpd.conf
> >
> > PerlSetEnv EMBPERL_COOKIE_DOMAIN .genwax.com
> > PerlSetEnv EMBPERL_COOKIE_PATH /
> > PerlSetEnv EMBPERL_COOKIE_EXPIRES 'Friday, 31-Dec-2010 14:00:00 GMT'
> >
> > how are you checking to make sure cookies are sent?
> >
> > lwp-request -e 'http://www.domain.com/path/to/page/with/embperl|less
> >
> > You should see a SET-COOKIE header.
>
> I inserted those lines above into my httpd.conf, and did the
> lwp-request. All headers I do see are the following:
> 
> Connection: close
> Date: Thu, 13 Jan 2000 14:39:53 GMT
> Server: Apache/1.3.9 (Unix) mod_perl/1.21 PHP/3.0.12
> Content-Type: text/html
> Client-Date: Thu, 13 Jan 2000 14:39:53 GMT
> Client-Peer: 145.228.112.103:80
> Title: sessiontest 1
> 
>
> Can you please send me a simple testpage for this, maybe I do
> something wrong in my embperl code... I have only begun with perl
> 6 weeks ago or so and I still have not understood all mystiques
> ;-)
>
> Take care,
> Andre



Re: Embperl + Apache::Session

2000-01-13 Thread Andre Landwehr

On Thu, Jan 13, 2000 at 12:47:08PM -0800, Cliff Rayman wrote:
> 
> testing
> 
> This is my counter:
> [+ $udat{COUNTER}++ +]
> 
> 
> 
> 
> use your browser to view the page.
> keep hitting reload - counter should increase.

so my english was good enough to understand the documentation
after all... unfortunately the counter stays zero, no matter how
often I reload the page and no cookie is sent, as I suspected.
Could you please send me your complete apache configuration
files? Maybe it works with your files on my machines which would
give me a hint where to search...

Andre


 PGP signature


Re: Embperl + Apache::Session

2000-01-13 Thread Gerald Richter

> On Wed, Jan 12, 2000 at 11:12:53AM -0800, Cliff Rayman wrote:
> > i am using embperl with cookies.
> > i also have this set in httpd.conf
> >
> > PerlSetEnv EMBPERL_COOKIE_DOMAIN .genwax.com
> > PerlSetEnv EMBPERL_COOKIE_PATH /
> > PerlSetEnv EMBPERL_COOKIE_EXPIRES 'Friday, 31-Dec-2010 14:00:00 GMT'
> >
> > how are you checking to make sure cookies are sent?
> >
> > lwp-request -e 'http://www.domain.com/path/to/page/with/embperl|less
> >
> > You should see a SET-COOKIE header.
>

You need to setup session handling at all, e.g.

 PerlSetEnv EMBPERL_SESSION_CLASSES "FileStore SysVSemaphoreLocker"

Read the docs about Apache::Session which Stores and Locker modules are
available.
When you restart your apache, you should see a message about EMbperl Session
management enabled. Without this message it won't work

> I inserted those lines above into my httpd.conf, and did the
> lwp-request. All headers I do see are the following:

You will only get the cookie header if you write to the %udat hash inside
your page

Gerald






Re: Embperl + Apache::Session

2000-01-14 Thread Andre Landwehr

On Fri, Jan 14, 2000 at 07:00:13AM +0100, Gerald Richter wrote:
> 
> You need to setup session handling at all, e.g.
> 
>  PerlSetEnv EMBPERL_SESSION_CLASSES "FileStore SysVSemaphoreLocker"

That is PerlSetEnv EMBPERL_SESSION_CLASSES "FileStore NullLocker"
in my httpd.conf

> When you restart your apache, you should see a message about EMbperl Session
> management enabled. Without this message it won't work

You talk about this one, don't you?
--
root@linbec31:/download/Perl/HTML-Embperl-1.2.1 #
/etc/rc.d/init.d/httpd start
[1392]SES:  Embperl Session management enabled (1.xx)
/etc/rc.d/init.d/httpd start: httpd started
--
I saw that message every time since I started playing around with
session handling, but despite the message it does not work


> You will only get the cookie header if you write to the %udat hash inside
> your page
I have done this, using the sample page implementing a counter posted
yesterday on this list. As I explained session management works
as far as generating the id and saving it into %udat, but it
simply does not set the cookie

Since this happens on two machines with at least slightly different Linux
distributions (one is Mandrake 6.0, the other a Redhat 5.2) I
think it is a configuration problem... so if someone could please
email me her complete configuration files I'd have more means to
test

Andre



RE: Embperl + Apache::Session

2000-01-14 Thread Gerald Richter

>
> Since this happens on two machines with at least slightly different Linux
> distributions (one is Mandrake 6.0, the other a Redhat 5.2) I
> think it is a configuration problem... so if someone could please
> email me her complete configuration files I'd have more means to
> test
>
What you describe looks good to me. There is one other issue, that is
dynamlic linking mod_perl. How comes mod_perl into your Apache? Is it
dynamicly loaded at runtime (i.e. by a LoadModule in your httpd.conf) or is
it staticly loaded?

If the first is true, look if Embperl is loaded somewhere in your httpd.conf
(either by a PerlModule or by a file that is loaded with PerlRequire).
Remove this. In case of dynamicly linking Embperl must not loaded at startup
time. (mod_perl will do this at request time for you)

Gerald


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

Post:   Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925151
WWW:http://www.ecos.de  Fax:  +49 6133 925152
-




RE: Embperl + Apache::Session

2000-01-14 Thread Gerald Richter

> PerlModule HTML::Embperl

This line loads Embperl at startup, remove it!

>
> I could also build embperl staticly, maybe that helps.

This will surly solve a lot of problems.

> But a quick
> try some minutes ago with just recompiling mod_perl with
> USE_DSO=0 and configuring apache with --disable_shared=perl was
> not successful. The configure script told me of mod_perl
> buildtype being OBJ, but I could not start the server afterwards
> because it complained about not knowing those PerlSetEnv and
> PerlModule lines above. Any ideas about that?
>

Try to run Makefile.PL with the following parameters (change the directories
of course):

APACHE_SRC=/usr/src/packages/apache_1.3.9_mp/src
USE_APACI=1
DO_HTTPD=1
APACHE_PREFIX=/usr/local/apache

then type

make

and

make install

and you should have a new httpd in /usr/local/apache/bin

Gerald




Re: Embperl + Apache::Session

2000-01-14 Thread Andre Landwehr

On Fri, Jan 14, 2000 at 01:31:17PM +0100, Gerald Richter wrote:
> What you describe looks good to me. There is one other issue, that is
> dynamlic linking mod_perl. How comes mod_perl into your Apache? Is it
> dynamicly loaded at runtime (i.e. by a LoadModule in your httpd.conf) or is
> it staticly loaded?
> 
> If the first is true, look if Embperl is loaded somewhere in your httpd.conf
> (either by a PerlModule or by a file that is loaded with PerlRequire).
> Remove this. In case of dynamicly linking Embperl must not loaded at startup
> time. (mod_perl will do this at request time for you)


I made a further test by now, with staticly linked mod_perl and without 
preloading HTML::Embperl in httpd.conf.

Doing a "tail -f /var/log/apache/error.log" I see "[11159]SES:
Embperl Session management enabled (1.xx)" (with the number
in brackets changing of course) every time I reload my
testpage. But I can also still see the session-id changing with
every reload, and no cookie is set, just like before.
Does the changing id not indicate that sessionmanagement is
basically working and there is just something terribly wrong with
the cookie part? Maybe I did not install some package from CPAN
correctly (although I cannot remember seeing any error
during installation)?

Andre


 PGP signature


Re: EmbPerl and scope

2000-01-15 Thread Vijay

I used following method to get Embperl working in my system.

[- Execute ('other.html',"$a") -]

other.html

The value of a is [+ $param[0] +]

This works fine.

Vijay Nair
- Original Message -
From: Louis Trochatos <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, January 15, 2000 8:19 PM
Subject: EmbPerl and scope


> I am having trouble with embperl and scope. I read the FAQ on this but I
> still can't get it to work. As an example let's say I have two files:
>
> file1: index.html
> --
>
> [- $a = 1 -]
>
> [- Execute ('other.html') -]
>
> file2: other.html
> ---
>
> The value is the variale a is:
> [+ $a +]
>
>
>
> when i bring up index.html it does import other.html fine but the $a
variale
> is empty - scope problem. What exactly do i need to do to these  files so
> they can talk to each other.
>
> Also does anyone know of a good embperl book on the market?
>
> thanks
>
> Louis
>
>
>



RE: Embperl + Apache::Session

2000-01-16 Thread Gerald Richter

>
> I made a further test by now, with staticly linked mod_perl and without
> preloading HTML::Embperl in httpd.conf.
>

If you staticly linked mod_perl you should preload Embperl, but it should
also work without preloading.

> Doing a "tail -f /var/log/apache/error.log" I see "[11159]SES:
> Embperl Session management enabled (1.xx)" (with the number
> in brackets changing of course) every time I reload my
> testpage.

That's ok

> But I can also still see the session-id changing with
> every reload, and no cookie is set, just like before.

What do you mean by session id? The number inside the square bracktes id the
pid of the Apache child. Or do you mean other things?

> Does the changing id not indicate that sessionmanagement is
> basically working and there is just something terribly wrong with
> the cookie part? Maybe I did not install some package from CPAN
> correctly (although I cannot remember seeing any error
> during installation)?
>

I just searched for your initial mail and the module versions you metioned
there should work just fine.

Please try to include the following output in your test page:

1 = [+ ref (tied(%udat)) +]
2 = [+ ref (tied(%HTML::Embperl::udat)) +]
3 = [+ $Apache::Session::VERSION +]
4 = [+ $HTML::Embperl::Session::VERSION +]

what is the output of this?

Gerald


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

Post:   Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925151
WWW:http://www.ecos.de  Fax:  +49 6133 925152
-



Re: Embperl + Apache::Session

2000-01-16 Thread Andre Landwehr

On Sun, Jan 16, 2000 at 01:50:09PM +0100, Gerald Richter wrote:
> > But I can also still see the session-id changing with
> > every reload, and no cookie is set, just like before.
> 
> What do you mean by session id? The number inside the square bracktes id the
> pid of the Apache child. Or do you mean other things?

I mean the ID saved as _session_id in %udat. I have a line "print
%udat;" in my page to check if that number changes.

> Please try to include the following output in your test page:
> 
> 1 = [+ ref (tied(%udat)) +]
> 2 = [+ ref (tied(%HTML::Embperl::udat)) +]
> 3 = [+ $Apache::Session::VERSION +]
> 4 = [+ $HTML::Embperl::Session::VERSION +]
> 
> what is the output of this?

1 = HTML::Embperl::Session 
2 = HTML::Embperl::Session 
3 = 1.04 
4 = 1.00 

Andre


 PGP signature


RE: EmbPerl and scope

2000-01-16 Thread Gerald Richter

> I am having trouble with embperl and scope. I read the FAQ on this but I
> still can't get it to work. As an example let's say I have two files:
>

Each file runs in it's own namespace (package name), so you won't see
globals from another page. You must pass them as parameters, as Vijay
already pointed out.

Gerald



RE: Embperl + Apache::Session

2000-01-16 Thread Gerald Richter

> > > But I can also still see the session-id changing with
> > > every reload, and no cookie is set, just like before.
> >
> > What do you mean by session id? The number inside the square
> bracktes id the
> > pid of the Apache child. Or do you mean other things?
>
> I mean the ID saved as _session_id in %udat. I have a line "print
> %udat;" in my page to check if that number changes.
>

ok, so this means that everytime there is a new session id generated. This
is because the cookie is not comming thru. If everything is ok, the session
id shouldn't change.

> > Please try to include the following output in your test page:
> >
> > 1 = [+ ref (tied(%udat)) +]
> > 2 = [+ ref (tied(%HTML::Embperl::udat)) +]
> > 3 = [+ $Apache::Session::VERSION +]
> > 4 = [+ $HTML::Embperl::Session::VERSION +]
> >
> > what is the output of this?
>
> 1 = HTML::Embperl::Session
> 2 = HTML::Embperl::Session
> 3 = 1.04
> 4 = 1.00
>
This looks also good, very strange. Does the "make test" of Embperl runs
with all ok, for you? Could you send me your httpd.conf (private email)?

Gerald



RE: Embperl + Apache::Session

2000-01-16 Thread Gerald Richter

>
> > Could you send me your httpd.conf (private email)?
>
> sure, here it is..
>
This looks ok for the Embperl part, but if you have now staticly linked
mod_perl you should throw out the LoadModule perl_module . I don't know
what Apache does, if a module is staticly and dynamicly present, but this
doesn't seems to be a good idea...

Gerald




RE: EmbPerl and scope

2000-01-16 Thread Louis Trochatos

Thanks!

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Vijay
Sent: Saturday, January 15, 2000 11:37 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: EmbPerl and scope


I used following method to get Embperl working in my system.

[- Execute ('other.html',"$a") -]

other.html

The value of a is [+ $param[0] +]

This works fine.

Vijay Nair
- Original Message -
From: Louis Trochatos <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, January 15, 2000 8:19 PM
Subject: EmbPerl and scope


> I am having trouble with embperl and scope. I read the FAQ on this but I
> still can't get it to work. As an example let's say I have two files:
>
> file1: index.html
> --
>
> [- $a = 1 -]
>
> [- Execute ('other.html') -]
>
> file2: other.html
> ---
>
> The value is the variale a is:
> [+ $a +]
>
>
>
> when i bring up index.html it does import other.html fine but the $a
variale
> is empty - scope problem. What exactly do i need to do to these  files so
> they can talk to each other.
>
> Also does anyone know of a good embperl book on the market?
>
> thanks
>
> Louis
>
>
>




Re: Embperl + Apache::Session

2000-01-16 Thread Andre Landwehr

On Sun, Jan 16, 2000 at 03:37:51PM +0100, Gerald Richter wrote:
> This looks ok for the Embperl part, but if you have now staticly linked
> mod_perl you should throw out the LoadModule perl_module . I don't know
> what Apache does, if a module is staticly and dynamicly present, but this
> doesn't seems to be a good idea...

Wow, I don't believe it! It works now that I commented out the
LoadModule line! At least it does so for requests with lynx and
lwp-request, Netscape for some reason still does either not receive
or accept the cookie, but that should be a minor issue now.

Well, I think this is an unspecified if not even unreproducable
behaviour of apache I ran into here because of my blindness ;-). Many 
thanks for your help, especially Geralds!

Andre


 PGP signature


RE: Embperl + Apache::Session

2000-01-16 Thread Gerald Richter

> On Sun, Jan 16, 2000 at 03:37:51PM +0100, Gerald Richter wrote:
> > This looks ok for the Embperl part, but if you have now staticly linked
> > mod_perl you should throw out the LoadModule perl_module .
> I don't know
> > what Apache does, if a module is staticly and dynamicly
> present, but this
> > doesn't seems to be a good idea...
>
> Wow, I don't believe it! It works now that I commented out the
> LoadModule line! At least it does so for requests with lynx and
> lwp-request, Netscape for some reason still does either not receive
> or accept the cookie, but that should be a minor issue now.
>
> Well, I think this is an unspecified if not even unreproducable
> behaviour of apache I ran into here because of my blindness ;-). Many
> thanks for your help, especially Geralds!
>
I guess because of the LoadModule line, Apache use the dynamic linked
mod_perl. Because of the way Apache loads such modules and the way mod_perl
loads additional Perl modules which has XS extentions, there are some
trouble. I know where the problem lies, but I don't have a solution for now.
I have to investigate it more...

Gerald





RE: Embperl vs. Mason

2000-02-14 Thread Gerald Richter

Hi,
> I made some pages with Embperl, but I don't know Mason. Yesterday
> a friend told me of Mason, but he does not know Embperl very
> well. Now I wonder about the pros and cons of each, not only in
> respect to performance but also general usability, bugs etc.
> What do more experienced web programmers than I am think about
> Embperl or Mason?

Search the modperl mailinglist archive for discussions about that

> btw: Is the new EmbperlObject somewhat comparable to Mason's
> component model?
>

Embperl supports components since a long time (via Execute and [$ sub $]).
The EmbperlObject is a new way to put components together. If you want to
compare EmbperlObject you must compare it with Masons dhandler and
autohandler (see www.masonhq.com)

Gerald



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

Post:   Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925151
WWW:http://www.ecos.de  Fax:  +49 6133 925152
-



Re: Embperl vs. Mason

2000-02-14 Thread Joshua Chamas

Andre Landwehr wrote:
> 
> Hi,
> I made some pages with Embperl, but I don't know Mason. Yesterday
> a friend told me of Mason, but he does not know Embperl very
> well. Now I wonder about the pros and cons of each, not only in
> respect to performance but also general usability, bugs etc.
> What do more experienced web programmers than I am think about
> Embperl or Mason?
> btw: Is the new EmbperlObject somewhat comparable to Mason's
> component model?
> 

Hi Andre,

I am unbiased in that I do not use either, but know about 
stuff like this since I wrote my own equivalent to these
web application environments, which will go unnamed ;)

Embperl seems to be more script centric, and Mason seems
more site centric, so mental approaches might differ
between top down vs. bottom up.  

I am not meaning to disparage either environment in creating 
these very rough generalizations, but I believe that their 
respective talents lie in these directions, such that you 
might find yourself better enabled creating particular scripts 
with Embperl, but in creating a master site of sites, Mason 
might make things better.

I can tell you that Embperl is much easier to get going, and 
has a very powerful set of objects to work with as well as a 
rich syntax.  But the Mason site architecture is very advanced, 
and promises other features like a great debugger and 
application publisher.

Also, Embperl is a bit faster on startup execution, but this
should not matter on a large complex site.  Both environments
provide expert modularization & caching methodologies with 
Mason's component architecture and Embperl's new object and
Execute() routine.

-- Joshua
_
Joshua Chamas   Chamas Enterprises Inc.
NodeWorks >> free web link monitoring   Huntington Beach, CA  USA 
http://www.nodeworks.com1-714-625-4051



Re: Embperl vs. Mason

2000-02-14 Thread dreamwvr

hi,
  my ignorance on Embperl is about to show;-)) tell me 
what would one be looking at to write apps for say the 
casios and Pilot 5s in linux? will embedded perl work?
is it the right choice? this to map to web technologies 
of course:-))
   Regards,
  [EMAIL PROTECTED]



Re: Embperl vs. Mason

2000-02-14 Thread Autarch

On Mon, 14 Feb 2000, Andre Landwehr wrote:

> I made some pages with Embperl, but I don't know Mason. Yesterday
> a friend told me of Mason, but he does not know Embperl very
> well. Now I wonder about the pros and cons of each, not only in
> respect to performance but also general usability, bugs etc.
> What do more experienced web programmers than I am think about
> Embperl or Mason?

Well, I haven't used Embperl but I've read the docs a bit and I have some
idea of how it works.

One big difference that I would point out is that despite its name
HTML::Mason, is _much_ less HTML centric than Embperl.  It is a bit
mod_perl centric but there is literally nothing HTML specific about it at
all.  We've been talking recently about how to expand mason so that it can
be used in any sort of context where you have a request (from STDIN,
email, whatever) for content that you want filled by components.  From
what I can tell, this is unlikely to be possible (or desirable?) with
Embperl.

This means that learning Mason for your website could let you leverage
this knowledge into creating a generic server, a command line filtering
command set, or whatever.


-dave

/*==
www.urth.org
We await the New Sun
==*/




Re: Embperl vs. Mason

2000-02-14 Thread Jason Bodnar

> One big difference that I would point out is that despite its name
> HTML::Mason, is _much_ less HTML centric than Embperl.  It is a bit
> mod_perl centric but there is literally nothing HTML specific about it at
> all.  We've been talking recently about how to expand mason so that it can
> be used in any sort of context where you have a request (from STDIN,
> email, whatever) for content that you want filled by components.  From
> what I can tell, this is unlikely to be possible (or desirable?) with
> Embperl.

You are incorrect. HTML::Embperl is not HTML specific. It can be used just as
easily to process regular text files for anything from email to configuration
files. It does have HTML-specific features (such as dynamically generated
tables) but you don't have to use these if you are working with plain old text
files.

---
Jason Bodnar + [EMAIL PROTECTED] + Tivoli Systems

I strive for greatness but will settle for mediocrity. -- Jason Bodnar



RE: Embperl vs. Mason

2000-02-14 Thread Autarch

On Mon, 14 Feb 2000, Gerald Richter wrote:

> > all.  We've been talking recently about how to expand mason so that it can
> > be used in any sort of context where you have a request (from STDIN,
> > email, whatever) for content that you want filled by components.
> 
> While you are talking, Embperl can already do this for over 3 years :-)

What we're talking about is coming up with a framework to provide this.
You can pretty much DIY with Mason right now but it would be nice to
formalize a lot of the mechanisms into separate classes and such.

> I think both Mason and Embperl (and Apache::ASP of course) are very
> powerfull and it's mainly a matter of style what you prefer.

I certainly wasn't trying to bash Embperl or anything else (though I
freely admit to preferring Mason).  If it seemed that way, allow me to
apologize.  It totally agree, it's largely a matter of style and perhaps
needing certain features more than others.


-dave


/*==
www.urth.org
We await the New Sun
==*/



RE: Embperl vs. Mason

2000-02-14 Thread Pascal Eeftinck

At 15:17 14-2-2000 -0600, Autarch wrote:
>On Mon, 14 Feb 2000, Gerald Richter wrote:
>
> > > all.  We've been talking recently about how to expand mason so that 
> it can
> > > be used in any sort of context where you have a request (from STDIN,
> > > email, whatever) for content that you want filled by components.
> >
> > While you are talking, Embperl can already do this for over 3 years :-)
>
>What we're talking about is coming up with a framework to provide this.
>You can pretty much DIY with Mason right now but it would be nice to
>formalize a lot of the mechanisms into separate classes and such.
>
> > I think both Mason and Embperl (and Apache::ASP of course) are very
> > powerfull and it's mainly a matter of style what you prefer.
>
>I certainly wasn't trying to bash Embperl or anything else (though I
>freely admit to preferring Mason).  If it seemed that way, allow me to
>apologize.  It totally agree, it's largely a matter of style and perhaps
>needing certain features more than others.

I don't know anything about XML etc. I know that I wanted something to offer
me some sort of templates and embedded Perl - I got kind of desperate writing
everything in CGI's.

So I hunted down all these options, Like Embperl, ePerl, Apache::ASP,
and of course HTML::Mason. I tried them all (one of the great things about
Open Source software :), and I picked the one I liked best. Which, in the
end, turned out to be Mason. (For example, Embperl's syntax for embedding
Perl just doesn't agree with me ... perhaps because it looks too much like
you're embedding TCL in StoryServer).

If you really want to know what's best for you you'll have to try it all
yourself. I guess it varies per person as well, depending on skills and
needs. Some systems might offer more features, while others will give you
more control. It's what you want and need that matters, not what others
think you should use (although I'll wholehartedly recommend Mason to anyone
asking :) ... it's exactly because of people's needs that we have more than
one such system around.

Grtz,
Pascal
--
Pascal Eeftinck - arcade^planet.nl
UIN: 1923806  arcade^xs4all.nl - Perl is not a language, it's a way of life




RE: Embperl vs. Mason

2000-02-14 Thread Gerald Richter

>
> Well, I haven't used Embperl but I've read the docs a bit and I have some
> idea of how it works.
>
> One big difference that I would point out is that despite its name
> HTML::Mason, is _much_ less HTML centric than Embperl.  It is a bit
> mod_perl centric but there is literally nothing HTML specific about it at
> all.  We've been talking recently about how to expand mason so that it can
> be used in any sort of context where you have a request (from STDIN,
> email, whatever) for content that you want filled by components.

While you are talking, Embperl can already do this for over 3 years :-)

> From
> what I can tell, this is unlikely to be possible (or desirable?) with
> Embperl.
>
> This means that learning Mason for your website could let you leverage
> this knowledge into creating a generic server, a command line filtering
> command set, or whatever.
>

As Jason already pointed out Embperl has a lot of features for HTML, but you
can use it for all sorts of textfiles. Embperl is highly configurable, if
you don't need/like a specific feature for a given problem, you can just
disable it. The idea of Embperl was to make life easy and to let Embperl
handle as much things as possible for you, but in some sitaution this don't
let you do the things like you want to do them, then you simply disable the
feature.

>From my point of view Mason is much more web (site) centric then Embperl
(this doesn't mean you can't use it outside a webserver)

When Mason came up it's great plus was it componenet model. Embperl has
learned a lot from Mason (and as Jonathan told me when we meet in summer on
the Perl conference, also Mason learnt form Embperl :-) and now Embperl has
also a component model which is as powerfull as the Mason one. The only
piece that is really missing, is the output cacheing of sub components (but
this is only a matter of time).

I think both Mason and Embperl (and Apache::ASP of course) are very
powerfull and it's mainly a matter of style what you prefer.

Gerald


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

Post:   Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925151
WWW:http://www.ecos.de  Fax:  +49 6133 925152
-



Re: Embperl configuration problem

2000-02-14 Thread Cliff Rayman

Your root Location directives are overriding your cgi-bin Location.
You set your embperl to skip all files but the ehtml, but that means
it does nothing with the .pl files.

Try this instead for the root Location.


   
SetHandler perl-script
PerlHandler HTML::Embperl
Options ExecCGI
   


cliff rayman
genwax.com

Jasper Wong wrote:

>
> ...
> Alias /cgi-bin/ "/abc/cgi-bin/"
> 
> SetHandler perl-script
> PerlHandler Apache::Registry
> Options ExecCGI
> PerlSendHeader On
> 
> 
> SetHandler perl-script
> PerlHandler HTML::Embperl
> PerlSetEnv EMBPERL_FILESMATCH "\.ehtml"
> Options ExecCGI
> 
> ...
> ...
>
> Here's the problem: this setup works fine for my embperl pages, but the
> perl files (*.pl)  in /cgi-bin fail to run and return as text files
> to the web browser.
> If I comment out the embperl section (comment out the whole )
> then the perl files in /cgi-bin work fine. What am I doing wrong?
> Comments are greatly appreciated. Thanks in advance.
>
> Best Regards,
> Jasper
>
> [EMAIL PROTECTED]



RE: Embperl configuration problem

2000-02-14 Thread Gerald Richter

...
> Alias /cgi-bin/ "/abc/cgi-bin/"
> 
>   SetHandler perl-script
>   PerlHandler Apache::Registry
>   Options ExecCGI
>   PerlSendHeader On
> 
> 
>   SetHandler perl-script
>   PerlHandler HTML::Embperl
>   PerlSetEnv EMBPERL_FILESMATCH "\.ehtml"
>   Options ExecCGI
> 
> ...
> ...

Move the /cgi-bin part after the / part, so it overwrites it and not vice
vera

Gerald



Re: Embperl vs. Mason

2000-02-14 Thread Jonathan Swartz

Nothing really to add here, except that since this seems to be a FAQ,
perhaps Stas would be willing to add a section about it that we could
just point to whenever this question comes up? A non-partisan page with
a focus on similarities and links to each site would be ideal.

At 12:39 AM 2/14/00 -0800, Joshua Chamas wrote:
>Hi Andre,
>
>I am unbiased in that I do not use either, but know about 
>stuff like this since I wrote my own equivalent to these
>web application environments, which will go unnamed ;)
>
>Embperl seems to be more script centric, and Mason seems
>more site centric, so mental approaches might differ
>between top down vs. bottom up.  
>
>I am not meaning to disparage either environment in creating 
>these very rough generalizations, but I believe that their 
>respective talents lie in these directions, such that you 
>might find yourself better enabled creating particular scripts 
>with Embperl, but in creating a master site of sites, Mason 
>might make things better.
>
>I can tell you that Embperl is much easier to get going, and 
>has a very powerful set of objects to work with as well as a 
>rich syntax.  But the Mason site architecture is very advanced, 
>and promises other features like a great debugger and 
>application publisher.
>
>Also, Embperl is a bit faster on startup execution, but this
>should not matter on a large complex site.  Both environments
>provide expert modularization & caching methodologies with 
>Mason's component architecture and Embperl's new object and
>Execute() routine.
>
>-- Joshua
>_
>Joshua Chamas  Chamas Enterprises Inc.
>NodeWorks >> free web link monitoring  Huntington Beach, CA  USA 
>http://www.nodeworks.com1-714-625-4051
> 



Re: Embperl vs. Mason

2000-02-14 Thread Stas Bekman

> Nothing really to add here, except that since this seems to be a FAQ,
> perhaps Stas would be willing to add a section about it that we could
> just point to whenever this question comes up? A non-partisan page with
> a focus on similarities and links to each site would be ideal.

Hmm, I hardly cope with the scope of information the guide tries to cover
already. I want to insert some more information that I've in my backlogs
and on TODO list and then to start working on reconstruction of the guide
toward easier navigation thru the available information. 

That's said, I definitely don't want to enlarge the scope even more at
this time. Therefore I think the best solution is to start a separate
document that does various comparisons Embperl vs. Mason, VB/ChilySoft vs. 
Apache::ASP etc. Having a section on each comparison sounds like a great
idea.

When the reconstruction of the guide will be started, one of the bricks
will be the comparisons chapter.

Meanwhile please prepare the document or part of it and post it to the
list for review and further upload to the perl.apache.org. Text or POD
formats should be used.

I understand that the review that Joshua has posted seems to be the
correct one. Am I right? 

Thank you.


___
Stas Bekmanmailto:[EMAIL PROTECTED]  http://www.stason.org/stas
Perl,CGI,Apache,Linux,Web,Java,PC http://www.stason.org/stas/TULARC
perl.apache.orgmodperl.sourcegarden.org   perlmonth.comperl.org
single o-> + single o-+ = singlesheavenhttp://www.singlesheaven.com



Re: Embperl vs. Mason

2000-02-15 Thread Joshua Chamas

Stas Bekman wrote:
> 
> > Nothing really to add here, except that since this seems to be a FAQ,
> > perhaps Stas would be willing to add a section about it that we could
> > just point to whenever this question comes up? A non-partisan page with
> > a focus on similarities and links to each site would be ideal.
> 
> Hmm, I hardly cope with the scope of information the guide tries to cover
> already. I want to insert some more information that I've in my backlogs
> and on TODO list and then to start working on reconstruction of the guide
> toward easier navigation thru the available information.
> 
> That's said, I definitely don't want to enlarge the scope even more at
> this time. Therefore I think the best solution is to start a separate
> document that does various comparisons Embperl vs. Mason, VB/ChilySoft vs.
> Apache::ASP etc. Having a section on each comparison sounds like a great
> idea.
> 
> When the reconstruction of the guide will be started, one of the bricks
> will be the comparisons chapter.
> 
> Meanwhile please prepare the document or part of it and post it to the
> list for review and further upload to the perl.apache.org. Text or POD
> formats should be used.
> 
> I understand that the review that Joshua has posted seems to be the
> correct one. Am I right?
> 

I'm all for putting up my rough review of Mason vs. Embperl up, but will 
Gerald & Jonathan do similar reviews of ASP vs. Mason, & Embperl vs. ASP.
I'm kind of interested in the generic feel of those gentlemen reversed.

Would some sort of grid be useful listing, comparing, even
ranking features for each environment ?  Is there anyone impartial
who could do this ?  Again it might be interesting to have the 
authors do it for each other.

--Joshua
_
Joshua Chamas   Chamas Enterprises Inc.
NodeWorks >> free web link monitoring   Huntington Beach, CA  USA 
http://www.nodeworks.com1-714-625-4051



RE: Embperl & Sessions, and Re: Embperl: Storing session info in FILES? (fwd)

2000-05-02 Thread Gerald Richter

Hello,

> What I need:
>
> - several cookies per user eg. to integrate TicketAccess with Embperl,
>   using different cookie names and other parameters like path info
>   or expire.

If you really need different cookies, you can implement them on your on with
the Set-Cookie http header. This seems only to make sense if you need
different cookie paths or different expire times. Don't know if it's very
user friendly, at least for user which get ask for every cookie the server
send, like me...

> Eg. getting a cookie in advance on "/tools/login.epl"
>   and then logging in doesn't make much sense when the cookie path
>   info is "/tools/login.epl" and thus should not be sent to eg.
>   "/vault/other/data/show.epl" or so.
>

There is a config directive EMBPERL_COOKIE_PATH you can use to set the
correct cookie path.

> - a way to say "logout". Currently, if I grab the cookie and then send
>   a new one with expire (1970) to the browser, %udat remains populated,
>   and the session data remains on disk. Unfortunately at the next
>   page load of anything I still have that same data in %udat.
>

%udat = () ;

will surely delete all data from %udat.

>   Saying "undef $udat{_session_id}" prevents me to log in a second time,
>   however, and is thus undesirable. Killing the browser to log out and
>   having no way to restart the old session is also not "the right thing
>   to do". My current "logout.epl" page looks like this (fully
>   experimental misquality). You can easily see at the end of the
>   page that I tried to call the DELETE method to remove the item
>   from the session store (mysql in my case), but dropped that.
>
> [-
>
> use CGI::Cookie;
>
> use lib "../config";
> use MyConfig;
>
>
> # inspired by keystone:
> sub killcookie {
>   my $cookie = shift;
>
>   $cookie->value ('deleted');
>   $cookie->expires ('-1');
>   $cookie->path ('/');
> }
>
>
> # as of perldoc CGI::Cookie
>
> %cookies = fetch CGI::Cookie;
>
> $MyCookie = $cookies{$MyConfig::CookieName};
>
> open LogFile, ">/tmp/my.log";
>
> print LogFile "Cookie: $MyCookie\n";
> print LogFile "other cookie actions:\n";
> foreach (keys %cookies) {
> next if $_ !~ /^\s*$/;
>
> print LogFile "killing ", $cookies{$_}, "\n";
> killcookie ($cookies{$_});
> $req_rec->header_out("Set-Cookie" => $cookie);

where is $cookie defined?

> }
> close LogFile;
>
> #undef $udat{_session_id};
>
> $udat{cookies} = \%cookies;
>

Why do you save \%cookie in %udat if you want to delete them. Wouldn't using
%udat = () ;
be better?

> #$udat{realname} = "Not logged in";
> $req_rec->header_out("Location" => "$ENV{HTTP_REFERER}");
> $req_rec->status (302);
>
> #tied (%udat)->delete;
>

Try to change the line 273 in Embperl/Session.pm from

if (!$self -> {'status'})

to

if (($self -> {'status'} & 7) == 0)

does the

tied (%udat)->delete;

work now?

Gerald

There is a new Embperl mailing list ([EMAIL PROTECTED])

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

Post:   Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925151
WWW:http://www.ecos.de  Fax:  +49 6133 925152
-




Re: EmbPerl for ActivePerl Distribution

2001-10-11 Thread Randy Kobes

On Thu, 11 Oct 2001, Grant Babb wrote:

> all-
>
> don't even start with me about using win2K: sometimes (make that ALL the
> times) you don't get to make those kind of decisions.
> i loaded Apache and mod_perl onto a win2k box with ActivePerl.  everything
> compiled and started without errors, thanks to the magical binaries of Mr
> Kobes and the Winnipeg site.  Then I  find that ActivePerl has no EmbPerl
> module my sole reason for installing mod_perl.  I know they have some
> proprietary version, but i will gladly pass on that.

Hi,
We have an HTML::Embperl ppm package (and also
Apache::ASP and HTML::Mason) at
http://theoryx5.uwinnipeg.ca/ppmpackages/
which you can install via the ppm utility in the same way that
the mod_perl package is installed from this location.

best regards,
randy kobes




Re: EmbPerl for ActivePerl Distribution

2001-10-11 Thread Gerald Richter

> We have an HTML::Embperl ppm package (and also
> Apache::ASP and HTML::Mason) at
> http://theoryx5.uwinnipeg.ca/ppmpackages/
> which you can install via the ppm utility in the same way that
> the mod_perl package is installed from this location.
>

And everthing could be found in Embperl's INSTALL.pod file :-) see:
http://perl.apache.org/embperl/INSTALL.pod.1.html#WIN_32_with_ActiveState_Pe
rl

Gerald



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

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





Re: embperl [* *] does not work

2001-12-19 Thread Gerald Richter

> I am trying [* *] tag and the code as simple as this does not work.

Note that [* *] is experimetal and will not work always in 1.3.x (it does in
2.0)

> I am using embperl 1.3.2 build from theoryx5.uwinnipeg.ca for Windows.
>

Please upgrade to the newest version (1.3.4), because there where a number
of bug fixes for win32

> 
> Test
>
> [* $c = 5; *]
> count: [+ $c +]
> [* $c++; *]
> count: [+ $c +]
> -
>

This normaly should work without problems. If it doesn't work after an
upgrade try to replace [* *] with [- -]

Gerald

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

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





RE: embperl make test problem

1999-10-01 Thread Mark Mills

>- The following addresses had permanent fatal errors -
> modeperl
 doh, that was dumb of me =)

This may seem obvious but try `which perl` as the make process user, from
that directory.

Does IRIX still hide perl in /usr/sbin?  the old 5.003 might still be first
in the path.  It bit me before on a origin...

> My machine is origin200 run on IRIX6.4. I did install apache 1.3.9 and
> modperl 1.21. Now I try to install embperl which I can pass all makefile
> but I get an error in make test process. I don't know why it cannot
> start my httpd which I can run it in the apache directoty. Here is the
> details: 
> 
> Thank in advance,
> --apple
> ---
> 
> div.htm to memory...  ok
> div.htm from/to memory... ok
> error.htm to memory...ok
> Use of uninitialized value at (eval 1218) line 1.
> 
> 
> Starting httpd...   [Fri Oct  1 14:55:45 1999] [error] "use" not
> allowed in expression at
> /opt/local/download/perlmodule/HTML-Embperl-1.2b9/test/conf/startup.pl
> line 13, at end of line
> BEGIN not safe after errors--compilation aborted at
> /opt/local/download/perlmodule/HTML-Embperl-1.2b9/test/conf/startup.pl
> line 13.
> 
> Syntax error on line 41 of
> /opt/local/download/perlmodule/HTML-Embperl-1.2b9/test/conf/httpd.conf:
> "use" not allowed in expression at
> /opt/local/download/perlmodule/HTML-Embperl-1.2b9/test/conf/startup.pl
> line 13, at end of line
> BEGIN not safe after errors--compilation aborted at
> /opt/local/download/perlmodule/HTML-Embperl-1.2b9/test/conf/startup.pl
> line 13.
> 
> Read on closed filehandle  at test.pl line 951.
> Cannot open test/tmp/httpd.pid at test.pl line 953.
> 
> Test terminated with fatal error
> Cannot open test/tmp/httpd.pid: No such file or directory
> Callback called exit.
> END failed--cleanup aborted.
> *** Error code 2 (bu21)
> 
> 


-- 
Mark Mills  <[EMAIL PROTECTED]>
Technical Research Advisor
  IXC Internet Services
 http://www.ixc-comm.com/
  800-962-3750



  1   2   3   >