RTF/MSword Generation from PERL

2003-09-17 Thread Philip M. Gollucci
Hi All,

I have an online FAQ.  Running under IIS 5.0/Win2k/PerlEx with
ActiveState Perl 5.6.1  ... sorry can't run 5.8.0 yet
The answers to the FAQ questions contain jpegs, bmps, and gifs

I'd like to repeatably generate RTF/MSWord 97 files from XHTML1.0 
Transitional
webpages 1 per FAQ (webpage) and 1 large ~300MB for the whole site.

I know I can use RTF::Writer and some other HTML::* modules
[Thanks Sean M. Burke :) ]
. but I'm a little iffy on the embedding of images in it ?  It can 
be done
since win2k app, 'write', supports it but via PERL ? Also, does anyone 
have a link
handy to the full spec ?

I can't seem to get any good search results on search.cpan.org for
MSWord is there a different phrase I should be looking for ?
Would SP/jade be a better solution ?

Thanks in advance.

END
-- 

Philip M. Gollucci

Consultant
E-Mail: [EMAIL PROTECTED] 
URL   : http://p6m7g8.net/Resume/resume.shtml
Phone : 301.474.9598

eJournalPress 
DBA / Software Engineer / System Administrator 
E-Mail: [EMAIL PROTECTED]
URL   : http://www.ejournalpress.com 
Phone : 301.530.6375

$Id: .signature,v 1.4 2003/05/02 23:46:37 philip Exp $





Re: apache2, mod_perl: problem with CGI

2003-09-08 Thread Philip M. Gollucci
Stas Wrote:

I believe it's not the problem Bart was talking about. You are most 
likely talking about Apache-request failing, which is how it should be 
if the GlobalRequest option is not set.  Bart's problem was finding 
the request method.

If you'll read carefully, you'll see that I'm talking about mod_perl 1.x 
not mod_perl 2.
Otherwise, I would completely agree.  The _exact_ same code _does_ work 
under mod_perl2.

I also see that the problem Bart was referring to was fixed in 2.93



Philip M. Gollucci wrote:

I'll disagree on this being a windows only problem in CGI. I'll also 
disagree about the version number.

As late as CGI 3.00 this problem exists in Apache 1.3.27 and mod_perl 
1.27 on SunOS.

The pdf troubleshooting doc on apache.org site suggest fix (I think 
its 5.17) also does _not_ work either

a temp work around I've come up with is

eval {
 $query = CGI-new();
};
return 1 if $@;
instead of just
$query = CGI-new();


Stas Bekman wrote:

Thanks that did it.


Great.

It would be nice though if the minimum rev level of the CGI.pm could be
mentioned in the doc.
Or maybe it is there somewhere and I skimmed over it.


It's a a CGI.pm problem, really. We can't go and support all possible 
modules that may or may not run under mod_perl 2.0. However we do 
have this section:
http://perl.apache.org/products/apache-modules.html#Porting_CPAN_modules_to_mod_perl_2_0_Status 

We probably should specify the version number of each of these 
modules. Can somebody please lookup those modules and send me a patch 
with the version number which starts to support mod_perl 2.0?

No need for Apache::Peek, CGI and CGI::Cookie since I know these 
versions already.

I'm CC'ing Shannon, since he has ported most of the auth modules.

The 'Configuring mod_perl2.0 page for win32' at
http://perl.apache.org/docs/2.0/os/win32/config.html would a nice 
place to
mention this.


Certainly not there, since it's windows specific and CGI.pm is used 
on all platforms. However we could link to the URL I have mentioned 
from other docs. I think porting docs are more relevant, than config.

  [Fri Sep 05 00:17:12 2003] [error] 1688: ModPerl::Registry: Can't 
locate
  object method request via package Apache at 
C:/Perl/lib/CGI.pm line
269.

upgrade your CGI.pm to 2.93 or higher.




__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com








Re: porting from mod_perl1 to mod_perl2

2003-09-06 Thread Philip M. Gollucci
If you check out the changes to CGI.pm on Licoln Stiens web site, utf8 
was added via a path by someone else
2.99 - 3.00 likely this is the cause.

Stas Bekman wrote:

Perrin Harkins wrote:

I am fairly sure it is not perl5.8.


I'm fairly sure it is.  What is your locale set to?  Are you on Red
Hat?  See previous discussions of locale issues on Red Hat 8 and 9 in
the list archives.


Bart is on win32, AS Perl 5.8. I doubt it's a locale issue, since it's 
the client who decides what encoding the data is in, it's either 
CGI.pm  (guessing that what he was using to parse the forms) or more 
low level (io) issues.

Bart, can you test whether you have the same problem when a run the 
same code under mod_cgi in Apache2 (with perl5.8 ofcourse)? If not, 
that will point the blaming finger towards mod_perl 2.0. Someone 
volunteers to add a new test? See

t/modperl/print_utf8.t
t/response/TestModperl/print_utf8.pm
for an example of testing the responding with utf8 data. You can 
probably adopt one of these couples for testing the posting of utf8 data:

t/apache/cgihandler.t
t/response/TestApache/cgihandler.pm
t/modules/cgi.t
t/response/TestModules/cgi.pm
t/modules/cgiupload.t
t/response/TestModules/cgiupload.pm
of course you will want to create a new couple of files for this test.

__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com






--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html


Re: apache2, mod_perl: problem with CGI

2003-09-05 Thread Philip M. Gollucci
I'll disagree on this being a windows only problem in CGI. I'll also 
disagree about the version number.

As late as CGI 3.00 this problem exists in Apache 1.3.27 and mod_perl 
1.27 on SunOS.

The pdf troubleshooting doc on apache.org site suggest fix (I think its 
5.17) also does _not_ work either

a temp work around I've come up with is

eval {
 $query = CGI-new();
};
return 1 if $@;
instead of just
$query = CGI-new();


Stas Bekman wrote:

Thanks that did it.


Great.

It would be nice though if the minimum rev level of the CGI.pm could be
mentioned in the doc.
Or maybe it is there somewhere and I skimmed over it.


It's a a CGI.pm problem, really. We can't go and support all possible 
modules that may or may not run under mod_perl 2.0. However we do have 
this section:
http://perl.apache.org/products/apache-modules.html#Porting_CPAN_modules_to_mod_perl_2_0_Status 

We probably should specify the version number of each of these 
modules. Can somebody please lookup those modules and send me a patch 
with the version number which starts to support mod_perl 2.0?

No need for Apache::Peek, CGI and CGI::Cookie since I know these 
versions already.

I'm CC'ing Shannon, since he has ported most of the auth modules.

The 'Configuring mod_perl2.0 page for win32' at
http://perl.apache.org/docs/2.0/os/win32/config.html would a nice 
place to
mention this.


Certainly not there, since it's windows specific and CGI.pm is used on 
all platforms. However we could link to the URL I have mentioned from 
other docs. I think porting docs are more relevant, than config.

  [Fri Sep 05 00:17:12 2003] [error] 1688: ModPerl::Registry: Can't 
locate
  object method request via package Apache at C:/Perl/lib/CGI.pm 
line
269.

upgrade your CGI.pm to 2.93 or higher.


__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com






--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html


Spell Checkers and EMail

2003-03-06 Thread Philip M. Gollucci
We send a good deal of templated based E-Mail with the option to edit right 
before sending.  The editing is done via webpage running under 
mod_perl/Apache or PerlEx/IIS with Oracle and MSSQL backends respectively.

Anyone know of any good modules to add a spellchecker ability to this edit 
screen or possibly the one on the next page (submit button) ?

Thanks for the advice.


-- 
END 
-- 
Philip M. Gollucci [EMAIL PROTECTED] 301.474.9294 301.646.3011 (cell) 

Science, Discovery,  the Universe (UMCP) 
Webmaster  Webship Teacher 
URL: http://www.sdu.umd.edu 

eJournalPress 
Database/PERL Programmer  System Admin 
URL : http://www.ejournalpress.com 

Resume : http://p6m7g8.net/Resume 



Fwd: Source Code Oraginzation

2003-03-04 Thread Philip M. Gollucci
from Stas advice, I'm forwarding this here, sans the crosspostings.

Thanks for the help.

--  Forwarded Message  --

Subject: Source Code Oraginzation
Date: Tue, 4 Mar 2003 15:58:38 +
From: Philip M. Gollucci [EMAIL PROTECTED]
To: [EMAIL PROTECTED], [EMAIL PROTECTED]

I need good reasons why to do the following

/cgi-bin
   *.pm
   *.plex files (PerlEX)
   *.cgi files
   _no subdirectories_

VS

/cgi-bin
  *.plex
  *.cgi

packages/AMS/
  some *.pm files
  more directories with other *.pm files
  OOP approach

Not quite sure where this one goes, but I know everyone here are more then
qualified to answer this.

I recently took shit for doing this, and I know at the _very_ least this
is correctly from a security standpoint as now _ALL_ our code is out of
web space.  I need other good reasons as well, other then for organization.

Also, documenting where a function is located ?

I like the namespace prefix

package HomeScreens;


@EXPORT = (
 hs_*
)

sub hs_* {

}

sub not_exported_func { }

VS

Export nothing
and use HomeScreens::hs_*();

I'd like to hear agruments for and against.



END
-
- Philip M. Gollucci [EMAIL PROTECTED] 301.474.9294 301.646.3011 (cell)

Science, Discovery,  the Universe (UMCP)
Webmaster  Webship Teacher
URL: http://www.sdu.umd.edu

eJournalPress
Database/PERL Programmer  System Admin
URL : http://www.ejournalpress.com

Resume : http://p6m7g8.net/Resume


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---

-- 
END 
-- 
Philip M. Gollucci [EMAIL PROTECTED] 301.474.9294 301.646.3011 (cell) 

Science, Discovery,  the Universe (UMCP) 
Webmaster  Webship Teacher 
URL: http://www.sdu.umd.edu 

eJournalPress 
Database/PERL Programmer  System Admin 
URL : http://www.ejournalpress.com 

Resume : http://p6m7g8.net/Resume 



MP2 and Databases

2003-01-25 Thread Philip M. Gollucci
What is the status of DBI, Apache::DBI and mod_perl-1.99_09-dev, 
 and Apache 2.1.0-dev ?

I saw Ask released .89 a few weeks ago to CPAN.  I just installed it, but 
I'm getting errors when trying to load it in the startup.pl


[Sat Jan 25 03:15:26 2003] [error] Can't locate Apache.pm in @INC (@INC 
contains: 
/home/philip/Developement/install/perl/lib/site_perl/5.9.0/i386-freebsd/Apache2 
/home/philip/Developement/install/perl/lib/5.9.0/i386-freebsd 
/home/philip/Developement/install/perl/lib/5.9.0 
/home/philip/Developement/install/perl/lib/site_perl/5.9.0/i386-freebsd 
/home/philip/Developement/install/perl/lib/site_perl/5.9.0 
/home/philip/Developement/install/perl/lib/site_perl .) at 
/home/philip/Developement/install/perl/lib/site_perl/5.9.0/i386-freebsd/Apache/DBI.pm 
line 3.
BEGIN failed--compilation aborted at 
/home/philip/Developement/install/perl/lib/site_perl/5.9.0/i386-freebsd/Apache/DBI.pm 
line 3.
Compilation failed in require at 
/home/philip/Developement/install/apache2-prefork/conf/startup.pl line 26.
BEGIN failed--compilation aborted at 
/home/philip/Developement/install/apache2-prefork/conf/startup.pl line 26.
Compilation failed in require at (eval 1) line 1.

[Sat Jan 25 03:15:26 2003] [error] Can't load Perl file: 
/home/philip/Developement/install/apache2-prefork/conf/startup.pl for s

-- 
END 
-- 
Philip M. Gollucci [EMAIL PROTECTED] 301.474.9294 301.646.3011 (cell) 

Science, Discovery,  the Universe (UMCP) 
Webmaster  Webship Teacher 
URL: http://www.sdu.umd.edu 

eJournalPress 
Database/PERL Programmer  System Admin 
URL : http://www.ejournalpress.com 

Resume : http://p6m7g8.net/Resume 





Re: mod_perl fails tests

2002-12-17 Thread Philip M. Gollucci
That parameter is a *mod_perl* not an *apache* one

it decides where the .pm files and such are installed
whether in a directory 'Apache' or 'Apache2'.

It will become the default eventually.  But for now, its useful
If you had 2 webservers 1.3.x and 2.0.x using the same version of perl
say 5.8.x .  

Its lack of is also useful for Maintaining comaptibility with 1.x
Modules not yet ported over.



On Wed, 2002-12-18 at 01:23, Jie Gao wrote:
 On Tue, 17 Dec 2002 [EMAIL PROTECTED] wrote:
 
  I am having some trouble installing mod_perl on my redhat linux 8.0 box.  I
 
  successfully installed apache 2.0.43 from source and placed it in the
  /usr/local/apache2 directory.  In addition, I downloaded the latest version of
  mod_perl from cvs. I successfully used the following command to generate the
  makefile: perl Makefile.PL MP_AP_PREFIX=/usr/local/apache2 MP_INST_APACHE2=1.
 
 I have a question related to this: Why the param MP_INST_APACHE2=? It would
 be good to be able to install apache in a user defined location, rather than
 only one location possible. This makes upgrades a bit risky. I maybe wrong, as
 documentation for apache2 is nowhere as clear as for apache 1.3*.
 
 Regards,
 
 
 
 Jie
 
  Even though the make process was successful the make test process was not.  As
  clear as I can tell from the error message that I listed below, mod_perl is
  looking for apache components in
  /home/software/apache_cvs/modperl-2.0/t/conf/httpd .conf which is clearly
  wrong since my httpd.conf file is in /usr/local/apache2/conf.
 
  Here is the error message:
 
  waiting for server to start: ...[Tue Dec 17 17:37:17 2002] [info] 19 Apache::
  modules loaded
  [Tue Dec 17 17:37:17 2002] [info] 5 APR:: modules loaded
  [Tue Dec 17 17:37:17 2002] [info] base server + 6 vhosts ready to run tests
  ..[Tue Dec 17 17:37:19 2002] [info] 19 Apache:: modules loaded
  [Tue Dec 17 17:37:20 2002] [info] 5 APR:: modules loaded
  .[Tue Dec 17 17:37:20 2002] [info] base server + 6 vhosts ready to run tests
  Syntax error on line 693 of
  /home/software/apache_cvs/modperl-2.0/t/conf/httpd.conf:
  Can't locate CGI.pm in @INC (@INC contains:
  /home/software/apache_cvs/modperl-2.0/blib/lib/Apache2
  /home/software/apache_cvs/modperl-2.0/blib/arch/Apache2
  /home/software/apache_cvs/modperl-2.0/Apache-Test/lib
  /home/software/apache_cvs/modperl-2.0/lib
  /home/software/apache_cvs/modperl-2.0/blib/lib
  /home/software/apache_cvs/modperl-2.0/blib/arch
  /home/software/apache_cvs/modperl-2.0/t/response
  /home/software/apache_cvs/modperl-2.0/t/protocol
  /home/software/apache_cvs/modperl-2.0/t/hooks
  /home/software/apache_cvs/modperl-2.0/t/filter
  /home/software/apache_cvs/modperl-2.0/t
  /home/software/apache_cvs/modperl-2.0/t/htdocs/testdirective/perlmodule-vh
  /home/software/apache_cvs/modperl-2.0/t/htdocs/testdirective/main
  /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0
  /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
  /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl
  /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
  /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl) at (eval 22) line
  3.
 
  !!!
  server has died with status 255 (t/logs/error_log wasn't created, start the
  server in the debug mode)
  make: *** [run_tests] Error 143
 
 
  Thanks for your help-
  Rodney
 
 
 
 
 




Modperl Footers/Headers

2002-04-02 Thread Philip M. Gollucci

Okay I've got an FBSD4.5 box with apache-1.3.24 with mod_perl1.26
I need to add a canned Footer to every page except one (toc.html).
This includes Location handlers, .cgi, .pl, .s?html

http://modperl.com:9000/perl_conference/cool_tricks/mp_footer.html
I saw that... but this doesn't work since .cgi, .pl files don't get
processed just read and output. (Works great for .html files though)

I think I may need to do something with Apache::OuputChain
but I don't know what.


Anywhere I should read that I'm missing ?

Thanks for the help.


END
--
Philip M. Gollucci (p6m7g8) [EMAIL PROTECTED] 301.314.3118 301.646.3011

Science, Discovery,  the Universe (UMCP)
Webmaster  Webship Teacher
URL: http://www.sdu.umd.edu

EJournalPress.com
Database/PERL Programmer  System Admin
URL : http://www.ejournalpress.com

Homepage: http://p6m7g8.com
Resume  : http://p6m7g8.com/Work/index.html
Software: http://p6m7g8.com/Developement/







Apache+Modperl Website Statistics

2002-03-27 Thread Philip M. Gollucci

Alright, I've been getting along pretty well so far here. Now I need an
extra feature though.  Resolution Stats (i.e. 1024x768 or 800x600)

I've got an apache-1.3.24 server with mod_perl-1.26
running.
in my httpd.conf, I've added
PerlLogHandler P6M7G8::Stats::DBILog

Which I have already written.
It gets Operating System Types, Browser Types, Date/Time, Cookie
information, Bytes transfered, CPU time taken, etc...

I know perl is server side and javascript is client side.
AFAIK, getting the resolution is a client side thing.
I know I can embed an html page with javascript in it that redirects to
a perl file setting the query string with width=1024;height=768
i.e.
#!/usr/bin/perl
use strict;
use CGI;

print Content-Type: text/html\n\n;

print CGI-start_html();
print qq {
  script type=text/javascript
!--
  var width  = screen.width;
  var height = screen.height;
  var next=/cgi-bin/stats.cgi?Width=' + width + ';Height=' + height;
  window.location = eval(next);
//--
  /script
  };
print CGI-end_html();

But, I need to find someway to do this without the extra redirect.
Is their anyway I can assign a perl scalar to the value of height and
width ? Also, it has to at least work in IE4.0+ NS4.0+ and Mozilla .98+ on
Windos, Linux, and Unix platforms.

As you can see the PerlLogHandler runs once for every request, and this
redirect would really get annoying and slow.

Any great ideas ?


END
--
Philip M. Gollucci (p6m7g8) [EMAIL PROTECTED] 301.314.3118

Science, Discovery,  the Universe (UMCP)
Webmaster  Webship Teacher
URL: http://www.sdu.umd.edu

EJPress.com
Database/PERL Programmer  System Admin
URL : http://www.ejournalpress.com

Resume  : http://p6m7g8.com/Work/index.html



On Thu, 21 Mar 2002, Murugan K wrote:

 Hi
Thanks in advance for your reply.

 How can i  maintain session informations  without cookie , hidden
 variables  through forms  in Perl.

 Is there any separate Apache module is available?

 Regards
 K.Murugan







Re: Apache+Modperl Website Statistics

2002-03-27 Thread Philip M. Gollucci

Well I've basically taken your route the first time I tried to do this a
year ago.  The other problem is that this requires the vistors go to
this particular page.  If they bookmark to another page or type the url
of a sublink, this is bypassed, and I loose the statistical information.
My problem is that the PerlLogHandler I've set up isn't actually supposed
to ever display anything to the browser.  (I don't think any PerLogHandler
anyone writes should send anything to the browser as is basically
an extension to use instead of the apache's access_log file.  Although
it could if you had a good reason.  In order for the javascript I gave to
get values it has to be sent to the browser on a page so its processed my the 
javascript engine
in the browsers.

END
--
Philip M. Gollucci (p6m7g8) [EMAIL PROTECTED] 301.314.3118

Science, Discovery,  the Universe (UMCP)
Webmaster  Webship Teacher
URL: http://www.sdu.umd.edu

EJPress.com
Database/PERL Programmer  System Admin
URL : http://www.ejournalpress.com

Resume  : http://p6m7g8.com/Work/index.html



On Wed, 27 Mar 2002, darren chamberlain wrote:

 * Philip M. Gollucci [EMAIL PROTECTED] [2002-03-27 09:59]:
  I know perl is server side and javascript is client side.
  AFAIK, getting the resolution is a client side thing.  I know I
  can embed an html page with javascript in it that redirects to
  a perl file setting the query string with width=1024;height=768

 [-- snip --]

  But, I need to find someway to do this without the extra
  redirect.

 Since, as you already realize, there is no way to get the client
 information from the server size, I think the best you can do
 would be something along the lines of: have a javascript
 enabled page that gets the height and width of the client (as
 you've shown), that then redirects the client to a location
 that can read the height and width from the query string and set
 a session cookie, which can then be read and acted upon for every
 subsequent request by a PerlTransHandler or RewriteRule.

 Does that sound reasonable?

 (darren)

 --
 Pessimests are right more often, but optimists are happy more often.





Re: Authentication redirection

2002-03-07 Thread Philip M. Gollucci

 $r-headers_out-set(Location = /whatever);
 $r-status(REDIRECT);
 $r-send_http_header;

I belive this will work for you.


END
--
Philip M. Gollucci (p6m7g8) [EMAIL PROTECTED] 301.314.3118

Science, Discovery,  the Universe (UMCP)
Webmaster  Webship Teacher
URL: http://www.sdu.umd.edu

EJPress.com
Database/PERL Programmer  System Admin
URL : http://www.ejournalpress.com

Resume  : http://p6m7g8.com/Work/index.html


On Thu, 7 Mar 2002, Christian Gilmore wrote:

 I am attempting to redirect certain users during the authentication phase
 to support password expiration management. I am not having success
 building it directly into the authentication module and think it may be
 perhaps that the internal REDIRECT constant is ignored if given outside of
 a content handling phase. Could someone confirm this thought? I was
 attempting this bit of code:

   if ($expired eq 'true') {
  $r-content_type('text/html');
  $r-header_out(Location = $redirect);
  return REDIRECT;
   }

 The behavior from this bit of code is just as if I had returned OK.

 My other idea is to just write a note on the board and have a downstream
 content handler do the redirection, but I was hoping to roll it all into
 one package, since the problem, password expiration, is most directly tied
 to authentication.

 Thanks,
 Christian

 -
 Christian Gilmore
 Team Lead
 Web Infrastructure  Tools
 IBM Software Group






Re: problems with $r-status('OK')

2002-03-04 Thread Philip M. Gollucci

you'll want to do
use Apache::Constants qw(OK);


and change that to
$r-status(OK);

as OK is actually defined as a constant function
sub OK {  0 }


END
--
Philip M. Gollucci (p6m7g8) [EMAIL PROTECTED] 301.314.3118

Science, Discovery,  the Universe (UMCP)
Webmaster  Webship Teacher
URL: http://www.sdu.umd.edu

EJPress.com
Database/PERL Programmer  System Admin
URL : http://www.ejournalpress.com

Resume  : http://p6m7g8.com/Work/index.html


On Mon, 4 Mar 2002, clayton cottingham wrote:

 hello:

 im using Apache/1.3.12
 and
 mod_perl/1.24

 every time i use
 the $r-status('OK');

 it gives me this error

 Argument OK isn't numeric in subroutine entry 

 has anyone come accross this before?

 thanks





Re: Weird mod_perl CGI.pm interaction (Bug?)

2002-02-09 Thread Philip M. Gollucci

try print B::show(), \n;


END
--
Philip M. Gollucci (p6m7g8) [EMAIL PROTECTED] 301.314.3118

Science, Discovery,  the Universe (UMCP)
Webmaster  Webship Teacher
URL: http://www.sdu.umd.edu

EJPress.com
Database/PERL Programmer  System Admin
URL : http://www.ejournalpress.com

Resume  : http://p6m7g8.com/Work/resume.html


On Thu, 7 Feb 2002, Mike McLagan wrote:

 Hello,

I have two scripts, call them A and B.  Here's what I'm doing (paraphrased
 heavily to save posting a huge pile of code):

 In data.html, I have:

!--#include virtual=A?action=show --

 In A, I have:

$q = new CGI;
show() if $q-param('action') eq 'show';

sub show
{
   Apache::Include-virtual(B?action=remove);
}

 In B, I have:

$q = new CGI;
show() if $q-param('action') eq 'show';
remove() if $q-param('action') eq 'remove';

sub show
{
   print B::show()\n;
}

sub remove
{
   print B::remove()\n;
}

 Inveriably, I end up with B::show() in my output, not at all what I wanted,
 expected or hoped for.

 What I see happening is that Apache::Registry is loading CGI.pm into the httpd
 child the first time it encounters a script that uses it.  This runs a number
 of functions within CGI.pm which set up variables, etc.  The call to new() in A
 then reads the query (GET or POST, doesn't matter) into @QUERY_PARAM.

 When B is invoked, within the same child, Apache::Registry DOES NOT reload
 CGI.pm and therefore does not initialize any of the variables, etc.  This
 results in the new() call in B REUSING (!) the @QUERY_PARAM which was built up
 during the new() call in A!  OOOPS!

 In order to make it work, I had to dig thru CGI.pm and found a function that's
 in there with comments about mod_perl around it, specifically:

CGI::initialize_globals();

 If I add this call in before both of the new() invocations, I get the desired,
 expected results.

 I'm not sure who to pin this on, mod_perl, Apache::Registry or CGI but it would
 seem to me that this qualifies as a bug, somewhere.

Michael







MS+HTML - Unix

2002-01-23 Thread Philip M. Gollucci

Say I have a webpage where I want to offer people the ability to upload
either a .txt or a .html file.  Now these people basically are computer
illierate, and don't even konw that UNIX is different from Microsh$t.

At anyrate, they will use Save as (HTML) from MSWord 97/2000, Save as
(txt), or worse yet, Save as RTF.
Then upload that.

Big surprise it gets it really wrong basically meaning it doesn't format
correctly before or after they use the site in any Browser.
One file, tidy told me had over 300 errors and that was just with HTML4.01
not XHTML1.0.

Is there anyway I can on the fly take the messed up HTML file I get and
covert it to what they meant to give me.

Important cases :
  Parrell Columns not in a table
  Bullets
  DIR tags
  actually closing u tags so the whole page isn't underlined.

I've see the demoronizer port, but don't know that much about it, and I
don't think its quite what I want.

Basically I have to take html given me and make the html they mean.


Any Great Ideas


END
--
Philip M. Gollucci (p6m7g8) [EMAIL PROTECTED] 301.314.3118

Science, Discovery,  the Universe (UMCP)
Webmaster  Webship Teacher
URL: http://www.sdu.umd.edu

EJPress.com
Database/PERL Programmer  System Admin
URL : http://www.ejournalpress.com

Resume  : http://www.p6m7g8.com/resume.txt





Re: Solaris + Apache + mod_perl = TROUBLE

2002-01-22 Thread Philip M. Gollucci

Thanks for the trouble time though.

--
Philip M. Gollucci (p6m7g8) [EMAIL PROTECTED] 301.314.3118

Science, Discovery,  the Universe (UMCP)
Webmaster  Webship Teacher
URL: http://www.sdu.umd.edu

EJPress.com
Database/PERL Programmer  System Admin
URL : http://www.ejournalpress.com

Resume  : http://www.p6m7g8.com/resume.txt


On Mon, 21 Jan 2002, John D Groenveld wrote:

  I have system (Solaris 2.6) which I do NOT have root on... (now I know why that
  doesn't happen often)
 No problem. Make sure root has applied the latest recommended patch set for
 2.6.

  At anyrate, I need to install perl5.6.1  ... I'll pay anyone able to do without
  using a binary release (on this particular solaris system (yes its that bad),
  Apache Apache-1.3.22 from source, and mod_perl1.26
 You should be able to build perl 5.6.1 from source and install it in your
 own directory.
 ./Configure -Dprefix=/virtual/www/sdu/perl -Dcc=gcc -Duseshrplib -Uusemymalloc 
-Ubincompat5005

 John
 [EMAIL PROTECTED]







Re: Solaris + Apache + mod_perl = TROUBLE

2002-01-22 Thread Philip M. Gollucci

Actually I tried that exact configure line one of the millions I tried it
for perl, and it got to make, where I got millions of undefined PL_*
errors.

I can't control what patches they have or have not applied... Is there
anyway I can check myself ?

I'm more of a BSD/FreeBSD expert.

--
Philip M. Gollucci (p6m7g8) [EMAIL PROTECTED] 301.314.3118

Science, Discovery,  the Universe (UMCP)
Webmaster  Webship Teacher
URL: http://www.sdu.umd.edu

EJPress.com
Database/PERL Programmer  System Admin
URL : http://www.ejournalpress.com

Resume  : http://www.p6m7g8.com/resume.txt


On Mon, 21 Jan 2002, John D Groenveld wrote:

  I have system (Solaris 2.6) which I do NOT have root on... (now I know why that
  doesn't happen often)
 No problem. Make sure root has applied the latest recommended patch set for
 2.6.

  At anyrate, I need to install perl5.6.1  ... I'll pay anyone able to do without
  using a binary release (on this particular solaris system (yes its that bad),
  Apache Apache-1.3.22 from source, and mod_perl1.26
 You should be able to build perl 5.6.1 from source and install it in your
 own directory.
 ./Configure -Dprefix=/virtual/www/sdu/perl -Dcc=gcc -Duseshrplib -Uusemymalloc 
-Ubincompat5005

 John
 [EMAIL PROTECTED]







Re: apache 2.0.28 and mod_perl

2002-01-18 Thread Philip M. Gollucci

Lots of luck.

I tried 1.26 and 2.0 last night... you'll get a lot of errors, unless I missed
something.

--
Philip M. Gollucci (p6m7g8) [EMAIL PROTECTED] 301.314.3118

Science, Discovery,  the Universe (UMCP)
Webmaster  Webship Teacher
URL: http://www.sdu.umd.edu

EJPress.com
Database/PERL Programmer  System Admin
URL : http://www.ejournalpress.com

Resume  : http://www.p6m7g8.com/resume.txt


On Fri, 18 Jan 2002, Bryan Henry wrote:

 are there issues with running mod_perl on Apache 2.0?
 I have not found any complaints or warnings in any documentation.
 regards,
 Bryan





Solaris + Apache + mod_perl = TROUBLE

2002-01-18 Thread Philip M. Gollucci

I have system (Solaris 2.6) which I do NOT have root on... (now I know why that
doesn't happen often)

At anyrate, I need to install perl5.6.1  ... I'll pay anyone able to do without
using a binary release (on this particular solaris system (yes its that bad),
Apache Apache-1.3.22 from source, and mod_perl1.26


So I get the binary release of perl installed.
Then I install apache
/virtual/www/sdu/perl/
/virtual/www/sdu/apache

All fine and good.

Then I try mod_perl-1.26

It tells me my PERL is compiled with -lpthreads and to use LIBS=-lpthread for my
httpd... Well I had to recompile apache to do this, no big deal, done...

Apache even starts and runs, but as soon as you go to a URL it serves, a child process 
gives :
[Fri Jan 18 07:24:07 2002] [notice] SIGHUP received.  Attempting to restart
[Fri Jan 18 07:24:08 2002] [notice] Apache/1.3.22 (Unix) mod_perl/1.26  configured -- 
resuming normal operations
[Fri Jan 18 07:24:08 2002] [notice] Accept mutex: fcntl (Default: fcntl)
[Fri Jan 18 07:24:24 2002] [notice] child pid 26203 exit signal Segmentation
Fault (11), possible coredump in /virtual/sdu/www/apache/bin/httpd

I don't see what I am missing here

System configuration and useful info follows:
[pts/1]:[EMAIL PROTECTED] /virtual/sdu/www/apache/bin 1169 ldd httpd
libpthread.so.1 =   /usr/lib/libpthread.so.1
libsocket.so.1 =/usr/lib/libsocket.so.1
libnsl.so.1 =   /usr/lib/libnsl.so.1
libdl.so.1 =/usr/lib/libdl.so.1
libc.so.1 = /usr/lib/libc.so.1
libmp.so.2 =/usr/lib/libmp.so.2
libthread.so.1 =/usr/lib/libthread.so.1
/usr/platform/SUNW,Ultra-250/lib/libc_psr.so.1

Note: it has pthread in it

uname -a
SunOS chameleon.umd.edu 5.6 Generic_105181-26 sun4u sparc SUNW,Ultra-250

Apache Configure
LIBS=-lpthread ./configure --prefix=$PREFIX/apache --enable-shared=max
--enable-module=most --with-port=$PORT_APACHE --with-perl=$PERL

mod_perl
$PERL Makefile.PL USE_APXS=1 WITH_APXS=$PREFIX/apache/bin/apxs EVERYTHING=1

perl -V
Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
  Platform:
osname=solaris, osvers=2.6, archname=sun4-solaris-thread-multi
uname='sunos sparky 5.6 generic_105181-26 sun4u sparc sunw,ultra-5_10 '
config_args='-des -Dcc=gcc -Dcf_by=ActiveState
[EMAIL PROTECTED] -Uinstallusrbinperl -Ud_sigsetjmp
-Dusethreads -Dusei
reads -Dinc_version_list=5.6.0/$archname 5.6.0
-Dprefix=/virtual/sdu/www/perl5.6.1'
hint=recommended, useposix=true, d_sigaction=define
usethreads=define use5005threads=undef useithreads=define
usemultiplicity=define
useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
  Compiler:
cc='gcc', ccflags ='-DUSE_REENTRANT_API -D_POSIX_PTHREAD_SEMANTICS
-D_REENTRANT -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOU
E -D_FILE_OFFSET_BITS=64',
optimize='-O',
cppflags='-DUSE_REENTRANT_API -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT
-fno-strict-aliasing -I/usr/local/include'
ccversion='', gccversion='2.95.2 19991024 (release)',
gccosandvers='solaris2.6'
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=8, usemymalloc=n, prototype=define
  Linker and Libraries:
ld='gcc', ldflags =' -L/usr/local/lib '
libpth=/usr/local/lib /usr/lib /usr/ccs/lib
libs=-lsocket -lnsl -ldl -lm -lposix4 -lpthread -lc
perllibs=-lsocket -lnsl -ldl -lm -lposix4 -lpthread -lc
libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib'
Characteristics of this binary (from libperl):
  Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES
PERL_IMPLICIT_CONTEXT
  Locally applied patches:
ActivePerl Build 631
  Built under solaris
  Compiled at Jan  3 2002 20:33:12
  %ENV:
PERL=/virtual/sdu/www/perl/bin/perl
  @INC:
/virtual/sdu/www/perl5.6.1/lib/5.6.1/sun4-solaris-thread-multi
/virtual/sdu/www/perl5.6.1/lib/5.6.1
/virtual/sdu/www/perl5.6.1/lib/site_perl/5.6.1/sun4-solaris-thread-multi
/virtual/sdu/www/perl5.6.1/lib/site_perl/5.6.1
/virtual/sdu/www/perl5.6.1/lib/site_perl







--
Philip M. Gollucci (p6m7g8) [EMAIL PROTECTED] 301.314.3118

Science, Discovery,  the Universe (UMCP)
Webmaster  Webship Teacher
URL: http://www.sdu.umd.edu

EJPress.com
Database/PERL Programmer  System Admin
URL : http://www.ejournalpress.com

Resume  : http://www.p6m7g8.com/resume.txt






Re: Ticket systems

2002-01-14 Thread Philip M. Gollucci

I am using Apache1.3.22/mod_perl1.26 with mod_usertrack.c

from httpd.conf
 #User Tracking
 LoadModule usertrack_module   libexec/mod_usertrack.so
 AddModule mod_usertrack.c
 CookieTracking on
 SetEnvIf Request_URI (\.gif|\.jpeg|\.js|\.css)$ junk
 CustomLog /usr/local/sites/dev/logs/clickstream 
%{cookie}n|%H|%m|%f|%U%q|%{User-agent}i|%{%m/%d/%Y %H:%M:%S}t env=!junk

Along with a cron job and MySQL to gather the Website Statistics
But on this site, I also have say a Admin Section or a WWW Posting Board
The user doesn't have to log into until they go to that section at which point

I use the following modules to authenticate them against MySQL and give them a
cookie only if they auth correctly (Careful, Apache::Cookie is broken as far as
I can tell with Apache::Session::MySQL hence the CGI)

use Apache;
use Apache::Request ();
use Apache::Constants qw(OK REDIRECT);
use Apache::Session::MySQL;
use CGI qw(:standard);
use DBI;


--
Philip M. Gollucci (p6m7g8) [EMAIL PROTECTED] 301.314.3118

Science, Discovery,  the Universe (UMCP)
Webmaster  Webship Teacher
URL: http://www.sdu.umd.edu

EJPress.com
Database/PERL Programmer  System Admin
URL : http://www.ejournalpress.com

Resume  : http://www.p6m7g8.com/resume.txt


On Mon, 14 Jan 2002, Viljo Marrandi wrote:

 Hello,

 I'm on a mission ta make a web-site that uses cookies for user log-in
 and log-out. First I'd like to know which one you suggest - Ticket
 system from Eagle book or Apache::AuthTicket. I know that
 Apache::AuthTicket is based on Eagle book's version, but it seems little
 more advanced.

 And now second problem. Has anyone modified one of these modules so,
 that when user first enters the site he will get a cookie immediately
 (with random generated ID) and can walk around there. And if he logs in
 then the cookie gets modified accordingly (saying that user is logged
 in).

 Here's the situation. I must make a site for insurance company. User can
 browse the site and see which offers he can get, if he wants to make a
 deal only then he must log in. But all the data that is calculated must
 be stored in dbase waiting for user to log in, so system can then, err,
 bind this temporary data with current user. But of course user can log
 in anytime he wants - even between different calculation steps.

 Any ideas are welcome.

 Rgds,
 Viljo





mod_perl : HELP (am I going nuts ?)

2002-01-09 Thread Philip M. Gollucci

The following short test script :

#!/usr/local/bin/perl

use strict;
use Apache;

my $r = shift;
my %params = $r-method eq 'POST' ? $r-content : $r-args;

$r-send_http_header('text/html');
print Name = [,  $params{'Name'}, ]br /;
print R = [ , $r, ]br /;
print Mehtod = [, $r-method, ]br /;
print Content = [, $r-content, ]br /;
print Args = [, $r-args, ]br /;


Now lets say I goto http://www.dev.p6m7g8.com/perl-reg/test.pl?Name=p6m7g8
which is the above file

Gives output :

Name = []
R = [Apache=SCALAR(0x80d3aac)]
Mehtod = [GET]
Content = []
Args = []

Comming from CGI.pm, I know you can pass parameters like the Name(above) for
urls, but with mod_perl (aka Apache::*) All I can get at are variables inside
form/form in an html page.

Am I missing something, am I going nuts ?
PLEASE PLEASE TELL ME WHAT I AM NOT DOING RIGHT HERE !

Thanks in advance for all you kind souls out there!


I have read almost all of but most especialy
http://perl.apache.org/guide/snippets.html#CGI_params_in_the_mod_perl_ish_
If I need to read something else please point me there


My System configuration follows:
uname -a
FreeBSD sduwebship.student.umd.edu 4.4-RELEASE FreeBSD 4.4-RELEASE #0: Tue Jan
8 03:41:06 GMT 2002
[EMAIL PROTECTED]:/usr/src/sys/compile/WEBSHIP  i386

perl -v
This is perl, v5.6.1 built for i386-freebsd

Apache/1.3.22 (Unix) mod_python/2.7.6 Python/2.1.1 PHP/4.0.6 mod_perl/1.26
mod_ssl/2.8.5 OpenSSL/0.9.6b


httpd.conf [snipped]
PerlRequire  /usr/local/www/apache/conf/startup.pl

Location /perl-status
  SetHandler perl-script
  PerlHandler Apache::Status
  order deny,allow
  deny from all
  allow from .student.umd.edu
/Location

Include conf/vhosts.conf

conf/vhosts.conf [snipped]
# START MOD_PERL #
Alias /perl-reg/ /usr/local/sites/dev/perl-reg/
PerlModule Apache::Registry
Location /perl-reg
SetHandler perl-script
PerlHandler Apache::Registry
Options ExecCGI
allow from all
PerlSendHeader On
/Location

startup.pl [entirety]
use strict;

# Make sure we are in a sane environment.
$ENV{MOD_PERL} or die not running under mod_perl!;

# For things in the /perl-reg  and /perl-run URL
use Apache::Status ();
use Apache::Registry;
use Apache::PerlRun;

# Load Perl modules of your choice here
# This code is interpreted *once* when the server starts
use LWP::UserAgent ();
use Apache::Status ();
use Apache::DBI ();
use DBI ();

$Apache::DBI::DEBUG = 2;
# Tell me more about warnings
use Carp ();
$SIG{__WARN__} = \Carp::cluck;

# Load CGI.pm and call its compile() method to precompile
# (but not to import) its autoloaded methods.
use CGI ();
CGI-compile(':all');

Apache::DBI-connect_on_init
 (DBI:mysql:database=test;host=localhost,
  test,,
  {
   PrintError = 1, # warn() on errors
   RaiseError = 1, # die on error
   AutoCommit = 1, # commit executes immediately
   Taint = 1   # Taint Checking on
  }
 );

1;



--
Philip M. Gollucci (p6m7g8) [EMAIL PROTECTED] 301.314.3118

Science, Discovery,  the Universe (UMCP)
Webmaster  Webship Teacher
URL: http://www.sdu.umd.edu

EJPress.com
Database/PERL Programmer  System Admin
URL : http://www.ejournalpress.com

Resume  : http://www.p6m7g8.com/resume.txt