Apache::Request

2003-04-01 Thread Ewald Geschwinde
I have read that the param Method had been deprecated

$r-param('value'):

How do I get now the variables from a submitted form ??

regards Ewald





[OT] YAPC::Israel

2003-04-01 Thread Issac Goldstand
Hey all,
 Was just wondering if anyone here was planning on attending
YAPC::Israel::2003 (http://www.perl.org.il/YAPC/2003 )?

  Issac



[mp2] upload file

2003-04-01 Thread Udlei Nattis
hi,

i have problem for upload files
testing use CGI and CGI::Simple
look file.pm:

   $cgi = CGI-new;
   $r-print($cgi-param(test). xxx );
file .html

form action=end method=post enctype=multipart/form-data
input type=file name=image
input type=hidden name=test value=abcdef
input type=submit
/form
when i add enctype param(test) return undefined value
and wne i remove enctype param(test) print abcdef
my question is: why when i add enctype, param(test) return undefined 
value?

sorry my english ;)

thanks



Re: cookie setting/retieval

2003-04-01 Thread Jason Jolly
Enrico,

If I do migrate to Apache::SessionManager will this problem disappear?  I
started looking into the transformation and it appears as if it will be a
good bit of work to accomplish the entire cutover and I just want to make
for sure that it's not something I'd have to build into my app anyway.

The reason I ask is because I was having some trouble with the
configuration?  After putting the following into the httpd.conf file

## BEGIN CONFIGURATION

PerlRequire /usr/local/apache/conf/startup.pl
PerlWarnOn
PerlFreshRestart  On
PerlModule Apache::SessionManager
PerlTransHandler Apache::SessionManager
Alias /perl /usr/local/apache/cgi-bin

Location /perl
SetHandler  perl-script
PerlSendHeader  On
PerlHandler Apache::Registry
PerlSetVar SessionManagerTracking On
PerlSetVar SessionManagerExpire 120
PerlSetVar SessionManagerInactivity 900
PerlSetVar SessionManagerName SESSION_ID
PerlSetVar SessionManagerStore File
PerlSetVar SessionManagerStoreArgs Directory = /tmp/sessions
PerlSetVar SessionManagerDebug 0
Options ExecCGI
allow from all
/Location

and using the code

## BEGIN CODE
sub validate {
my $r=shift;
my $cgi=new CGI;

my $session = Apache::SessionManager::get_session($r);

if (($$session{logged_in} eq Y)){
return $session;
}else{
print $cgi-redirect('http://' . $ENV{HTTP_HOST} .
'/perl/sess.cgi');
return $session;
}
}

I always get the error:

Can't locate object method pnotes via package package_name at
/usr/local/lib/perl5/site_perl/5.8.0/Apache/SessionManager.pm line 202,
TheFile line 28.


I'm sure I'm going about something wrong, but I seem to have hit a
roadblock.do I need to write my own handler for this?

thnx,

~j

- Original Message -
From: Enrico Sorcinelli [EMAIL PROTECTED]
To: Jason Jolly [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, April 01, 2003 1:52 AM
Subject: Re: cookie setting/retieval


 On Mon, 31 Mar 2003 18:11:21 -0600
 Jason Jolly [EMAIL PROTECTED] wrote:

  I'm currently in the process of writing a wrapper for a site using
Apache::Session and mod_perl.  I was having great success using the
following code to either validate a cookie which was already present or set
a new cookie if necessary:

 Hi Jason,
 don't reinvent the wheel! ;-)
 There's already an Apache::Session wrapper on CPAN called
Apache::SessionManager.
 Apache::SessionManager is a mod_perl module that helps session management
of a
 web application. It creates a session object and makes it available to all
 other handlers transparenlty. Also session expiration policies are
available.

 http://cpan.org/modules/by-module/Apache/Apache-SessionManager-0.04.tar.gz

 See perldoc Apache::SessionManager for more infos.

 by

 - Enrico



Re: Apache::Request

2003-04-01 Thread Stas Bekman
Ewald Geschwinde wrote:
I have read that the param Method had been deprecated

$r-param('value'):

How do I get now the variables from a submitted form ??
now? when? nothing has changed with Apache::Request. No April Fools jokes here.

__
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: [mp2] upload file

2003-04-01 Thread Stas Bekman
Udlei Nattis wrote:
hi,

i have problem for upload files
testing use CGI and CGI::Simple
look file.pm:

   $cgi = CGI-new;
   $r-print($cgi-param(test). xxx );
file .html

form action=end method=post enctype=multipart/form-data
input type=file name=image
input type=hidden name=test value=abcdef
input type=submit
/form
when i add enctype param(test) return undefined value
and wne i remove enctype param(test) print abcdef
my question is: why when i add enctype, param(test) return undefined 
value?
Does the same program works with mp1? Do you use the latest mp2 (at least 
1.99_08), better cvs?

The 2.0 test suite has an upload file test (CGI.pm) and it works fine with the 
current mod_perl. Please look at the pair:
t/modules/cgiupload.t
t/response/TestModules/cgiupload.pm
in the mod_perl source.

__
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


cgi.pm does not work in handlers (why responsehandlers at all ?)

2003-04-01 Thread pilsl
While I'm programming mod_perl for quite a while now I only recently
discovered the wonders of writing my own apache-handlers.

I used CGI.pm in my mod_perl-application to get 'path_info', 'param',
print out headers and more.
None of this works inside my own handlers any more.

I discovered replacements like Apache::Request but I'm now sure if
this would work inside a handler.

My Questions:

- which docs can you recommend that will answer all these questions to me like
  *why* does CGI.pm not work any more ?
  Is there any way to make it nevertheless work, so I could easily use my old projects 
?
  What to use instead ?
  

  Is the O'Reilly about apache-modules what I'm looking for ? I've the
small O'reilly about mod_perl but it raises more questions than its
answers.


- whats the maineffect of a simple ResponseHandler at all compared
with a perl-program run under mod_perl ? Is it much faster, cause it
handles things more efficiently ? By now I used to use an
Alias-Directive in apache to direct certains requests to a single
perl-script and use path_info() to detect the additional
arguments. For the use there is no difference at all.

thnx,
peter



-- 
mag. peter pilsl
IT-Consulting
tel: +43-699-1-3574035
fax: +43-699-4-3574035
[EMAIL PROTECTED]
http://www.goldfisch.at


Re: cgi.pm does not work in handlers (why responsehandlers at all?)

2003-04-01 Thread Stas Bekman
[EMAIL PROTECTED] wrote:

I used CGI.pm in my mod_perl-application to get 'path_info', 'param',
print out headers and more.
None of this works inside my own handlers any more.
Which mod_perl generation are you using? mod_perl 1.0 (1.27?) or mod_perl 2.0 
(1.99_08?). I suspect that you use mp2, since you mention later 
ResponseHandler, which doesn't exist in mp1. If that's the case, are you using 
the latest CGI.pm version? (older versions are known not malfunction with mp2).

If after getting the latest versions you still have problems, please post a 
*simple* several lines handler/script which doesn't work for you. Asking *why* 
CGI.pm doesn't work, is similar to asking why my car doesn't move from its 
place ;) You have to be more specific and then we will be able to figure out, 
what the problem is.

- whats the maineffect of a simple ResponseHandler at all compared
with a perl-program run under mod_perl ? Is it much faster, cause it
handles things more efficiently ? By now I used to use an
Alias-Directive in apache to direct certains requests to a single
perl-script and use path_info() to detect the additional
arguments. For the use there is no difference at all.
If you are talking about perl-scripts running under Apache::Registry or 
Apache::PerlRun, you are in fact running response handlers. The scripts are 
converted to such behind the scenes. In addition registry scripts do a few 
more things, which slow things down just a tiny-bit, probably insignificant if 
you programs are big enough. If you want to explore more, you will find this 
information and a lot more at http://perl.apache.org/docs/.

 I discovered replacements like Apache::Request but I'm now sure if
 this would work inside a handler.
Apache::Request works as a drop-in replacement for CGI.pm's request parsing 
for mp1. It's not yet available for mp2.

__
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: Segmentation fault - is Error.pm the culprit?

2003-04-01 Thread Brad Bowman

 This code essentially worked fine 2 weeks ago but at the time I removed my
 DBI HandleError subroutine. Today when adding it back in I am facing 
 this problem

I had a similar problem with HandleError, see the samples at:
http://bowman.bs/bugs/perl/

I just stopped using HandleError.  It also mysteriously seemed to
be effected by whether or not mod_perl was a dso.  It put it in
perlbug I think.

Brad

-- 
 Intelligence is nothing more than discussing things with others.
 Limitless wisdom comes of this. -- Hagakure




Re: cgi.pm does not work in handlers (why responsehandlers at all ?)

2003-04-01 Thread Thomas Klausner
Hi!

On Wed, Apr 02, 2003 at 12:49:56AM +0200, [EMAIL PROTECTED] wrote:

   Is the O'Reilly about apache-modules what I'm looking for ? I've the
 small O'reilly about mod_perl but it raises more questions than its
 answers.

The Eagle book is definitly very interesting (if a little bit old - BTW, is
there a new edition scheduled for mod_perl 2?).

You can find lots of other usefull docs at 
  http://perl.apache.org
including pointers to other books (eg. the mod_perl Developers Cookbook)


-- 
#!/usr/bin/perl   http://domm.zsi.at
for(ref bless{},just'another'perl'hacker){s-:+-$-gprint$_.$/}