<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>asp@perl.apache.org Archives</title>
<link rel="self" href="http://mail-archives.apache.org/mod_mbox/perl-asp/?format=atom"/>
<link href="http://mail-archives.apache.org/mod_mbox/perl-asp/"/>
<id>http://mail-archives.apache.org/mod_mbox/perl-asp/</id>
<updated>2009-12-08T00:27:55Z</updated>
<entry>
<title>Re: File upload problem</title>
<author><name>Warren Young &lt;warren@etr-usa.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-asp/200907.mbox/%3c4A53B494.90707@etr-usa.com%3e"/>
<id>urn:uuid:%3c4A53B494-90707@etr-usa-com%3e</id>
<updated>2009-07-07T20:48:20Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Andrew Koebrick (ADM) wrote:
&gt; Any thoughts on getting them to play well together?

The use of CGI.pm to construct file upload fields is a mere convenience. 
  You can do the same thing by writing raw HTML.  It's just uglier than 
the corresponding CGI.pm code, is all.

As I said above, all other uses of CGI.pm should have equivalents in 
Apache::ASP, so there's really no good reason to use CGI.pm.

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



</pre>
</div>
</content>
</entry>
<entry>
<title>RE: File upload problem</title>
<author><name>&quot;Andrew Koebrick (ADM)&quot; &lt;Andrew.Koebrick@state.mn.us&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-asp/200907.mbox/%3c447228DED2970A4C9A7CA38F1EF73A9624BE355121@MNMAIL02.ead.state.mn.us%3e"/>
<id>urn:uuid:%3c447228DED2970A4C9A7CA38F1EF73A9624BE355121@MNMAIL02-ead-state-mn-us%3e</id>
<updated>2009-07-07T20:01:29Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
It looks like I figured out my problem with the missing $Request-&gt;Form data. I have RequestBinaryRead
set to "Off".  Turning this off gives me content in  $Reqest-&gt;Form, but it unfortunately
seems to then break CGI.pm.  

I had ReqestBinaryRead turned off because of a different problem I was having back in 2004
with POST data truncation:
 http://www.mail-archive.com/asp@perl.apache.org/msg02159.html


So it looks like at this point CGI.pm and Apache::ASP are at odds.  Any thoughts on getting
them to play well together?  

Andrew Koebrick


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



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: File upload problem / $Request-&gt;Form problem</title>
<author><name>&quot;D. L. Fox&quot; &lt;webdev@frigginjiggy.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-asp/200907.mbox/%3c4A4E24EF.7020508@frigginjiggy.com%3e"/>
<id>urn:uuid:%3c4A4E24EF-7020508@frigginjiggy-com%3e</id>
<updated>2009-07-03T15:34:07Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Probably not what is causing your scenario but...

I once had a scenario similar to this and found the problem was in my
HTML. I needed to use both "id" and "name" attributes for each element
in the form. If I just used one or the other, it wouldn't pass any data
for that element.


Andrew Koebrick (ADM) wrote:

&gt; Any ideas on what could be botching or interfering with the Request object?


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



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: File upload problem</title>
<author><name>Warren Young &lt;warren@etr-usa.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-asp/200907.mbox/%3c4A4D1998.5080006@etr-usa.com%3e"/>
<id>urn:uuid:%3c4A4D1998-5080006@etr-usa-com%3e</id>
<updated>2009-07-02T20:33:28Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Andrew Koebrick (ADM) wrote:
&gt; Can't locate object method "request" via package "Apache" 

Have you tried this patch:

http://www.gossamer-threads.com/lists/modperl/asp/89060?search_string=yarrow;#89060

?

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



</pre>
</div>
</content>
</entry>
<entry>
<title>RE: File upload problem</title>
<author><name>&quot;Andrew Koebrick (ADM)&quot; &lt;Andrew.Koebrick@state.mn.us&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-asp/200907.mbox/%3c447228DED2970A4C9A7CA38F1EF73A9624BE0F6414@MNMAIL02.ead.state.mn.us%3e"/>
<id>urn:uuid:%3c447228DED2970A4C9A7CA38F1EF73A9624BE0F6414@MNMAIL02-ead-state-mn-us%3e</id>
<updated>2009-07-02T18:27:29Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
&gt;&gt; Would I be correct in guessing that this Apache::ASP application is 
brand new..?

Well, there have been the usual updates to the perl modules, but I have been running apache::asp
on the site since ~2000.  But as I generally only use apache::asp to embed the perl, rather
than to replace the CGI functionality, it could be that the problem is longer lasting. I have
access data from $Request-&gt;Form before, but not for a long while.

I am assuming the problem related to how apache::asp and mod_perl are interacting on my system.
 For a few asp versions, I had to patch ASP.pm to get it to run at all (ala this advice: http://www.gossamer-threads.com/lists/modperl/asp/82238;
basically testing for correct mod_perl version).  But with the latest version of the module,
that did not seem to be necessary.   I suspect it is this because of the error I mentioned
in my first note:

Can't locate object method "request" via package "Apache" at /home/httpd/html-MBA/Users/InputForms/MetaManager4.html
line 93. &lt;--&gt; , /usr/local/lib/perl5/site_perl/5.10.0/Apache/ASP.pm line 1522

Anyhow, I will keep digging; perhaps try a reinstall. Thanks for you assistance. 

Andrew 

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



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: File upload problem / $Request-&gt;Form problem</title>
<author><name>Warren Young &lt;warren@etr-usa.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-asp/200907.mbox/%3c4A4BD23B.1010701@etr-usa.com%3e"/>
<id>urn:uuid:%3c4A4BD23B-1010701@etr-usa-com%3e</id>
<updated>2009-07-01T21:16:43Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Andrew Koebrick (ADM) wrote:
&gt; 
&gt; asp title:
&gt; cgi title: test title

Would I be correct in guessing that this Apache::ASP application is 
brand new, and hasn't been running successfully for some time in the 
same configuration?  If so, I would guess that you don't yet have 
Apache::ASP set up correctly.  Try the examples, and the generic 
troubleshooting steps you can find in the mailling list archives and the 
docs.

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



</pre>
</div>
</content>
</entry>
<entry>
<title>RE: File upload problem / $Request-&gt;Form problem</title>
<author><name>&quot;Andrew Koebrick (ADM)&quot; &lt;Andrew.Koebrick@state.mn.us&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-asp/200907.mbox/%3c447228DED2970A4C9A7CA38F1EF73A9624BE0F5FED@MNMAIL02.ead.state.mn.us%3e"/>
<id>urn:uuid:%3c447228DED2970A4C9A7CA38F1EF73A9624BE0F5FED@MNMAIL02-ead-state-mn-us%3e</id>
<updated>2009-07-01T17:07:41Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Warren,

Thank you for the response.  

I had actually tried this syntax:

     if ($Request-&gt;{Method} eq 'POST') {
       my $form = $Request-&gt;Form;
       # process $form-&gt;{stuff} here
     }

But I can not seem to access anything from the form via this method.  In fact there seems
to be little I can get from the Request object.  If I submit my form and try:
	   print "Request total bytes $Request-&gt;{TotalBytes}&lt;br&gt;";
	   print "Request method $Request-&gt;{Method}&lt;br&gt;";

I get:
Request total bytes 0
Request method POST

Also when I try to grab any form content via the construct you suggest, I get no content.
 For example, in my form I have a required field 'Title'.  Testing access to my fields using
both CGI and the native asp methods:

	my $form = $Request-&gt;Form;
      my $title = $form-&gt;{'Title'};
      my $title2 = $query-&gt;param("Title");
	print "asp title: $title&lt;br&gt;";
	print "cgi title: $title2&lt;br&gt;";

results in

asp title:
cgi title: test title


Any ideas on what could be botching or interfering with the Request object?

Andrew Koebrick

-----Original Message-----
From: Warren Young [mailto:warren@etr-usa.com] 
Sent: Tuesday, June 30, 2009 8:42 PM
To: Apache-ASP List
Subject: Re: File upload problem

Andrew Koebrick (ADM) wrote:
&gt; (http://www.apache-asp.org/cgi.html) that the recommendation is to roll 
&gt; back to CGI v2.78.  

The docs are just giving that version as a known-working example.  I've 
successfully uploaded files to servers running CGI.pm v2.89 and v3.15.

&gt; I end up with an empty file on my server.

Empty, or missing?

If you're expecting to access the actual file-on-disk, rather just read 
the data via a file handle, you need to set

	PerlSetVar FileUploadTemp 1

in your httpd.conf file.  Otherwise, Apache deletes the temp file it 
uses to hold the upload.  As an example of why you'd care, my code sets 
this configuration variable this because the first thing it does is 'mv' 
the file to its new permanent home in the filesystem.

&gt; If I try to read directly from 
&gt; request-&gt;Form I get the error:

Perl is case-sensitive, and the $ is not optional.  It's 
"$Request-&gt;Form".  I typically do this at the top of pages that receive 
form posts:

     if ($Request-&gt;{Method} eq 'POST') {
       my $form = $Request-&gt;Form;
       # process $form-&gt;{stuff} here
     }

Being able to access the form values via $form saves a lot of typing.

&gt;  my $filename = $query-&gt;param("Identifier-upload");

I would only use CGI.pm to set up the file upload form, as described in 
the Apache::ASP docs.  I wouldn't continue to use it on the POST 
handling side like this.  Apache::ASP has its own mechanisms, which I'd 
trust more.  Using the shorthand above, you'd say
	
	my $filename = $form-&gt;{Identifier-upload};

instead.

&gt; my $upload_filehandle = $query-&gt;upload("Identifier-upload");

Again, you're fighting Apache::ASP by doing things through CGI.pm that 
Apache::ASP already does.  If you want just the file handle, that's

	$Request-&gt;{FileUpload}{upload_field}-&gt;{FileHandle}

...in ASP-speak.  See http://www.apache-asp.org/cgi.html#File%20Upload

If you set the httpd.conf variable as above, the name of the file is in

	$Request-&gt;{FileUpload}{mfile}-&gt;{TempFile}

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


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



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: File upload problem</title>
<author><name>Warren Young &lt;warren@etr-usa.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-asp/200907.mbox/%3c4A4ABEFF.4040700@etr-usa.com%3e"/>
<id>urn:uuid:%3c4A4ABEFF-4040700@etr-usa-com%3e</id>
<updated>2009-07-01T01:42:23Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Andrew Koebrick (ADM) wrote:
&gt; (http://www.apache-asp.org/cgi.html) that the recommendation is to roll 
&gt; back to CGI v2.78.  

The docs are just giving that version as a known-working example.  I've 
successfully uploaded files to servers running CGI.pm v2.89 and v3.15.

&gt; I end up with an empty file on my server.

Empty, or missing?

If you're expecting to access the actual file-on-disk, rather just read 
the data via a file handle, you need to set

	PerlSetVar FileUploadTemp 1

in your httpd.conf file.  Otherwise, Apache deletes the temp file it 
uses to hold the upload.  As an example of why you'd care, my code sets 
this configuration variable this because the first thing it does is 'mv' 
the file to its new permanent home in the filesystem.

&gt; If I try to read directly from 
&gt; request-&gt;Form I get the error:

Perl is case-sensitive, and the $ is not optional.  It's 
"$Request-&gt;Form".  I typically do this at the top of pages that receive 
form posts:

     if ($Request-&gt;{Method} eq 'POST') {
       my $form = $Request-&gt;Form;
       # process $form-&gt;{stuff} here
     }

Being able to access the form values via $form saves a lot of typing.

&gt;  my $filename = $query-&gt;param("Identifier-upload");

I would only use CGI.pm to set up the file upload form, as described in 
the Apache::ASP docs.  I wouldn't continue to use it on the POST 
handling side like this.  Apache::ASP has its own mechanisms, which I'd 
trust more.  Using the shorthand above, you'd say
	
	my $filename = $form-&gt;{Identifier-upload};

instead.

&gt; my $upload_filehandle = $query-&gt;upload("Identifier-upload");

Again, you're fighting Apache::ASP by doing things through CGI.pm that 
Apache::ASP already does.  If you want just the file handle, that's

	$Request-&gt;{FileUpload}{upload_field}-&gt;{FileHandle}

...in ASP-speak.  See http://www.apache-asp.org/cgi.html#File%20Upload

If you set the httpd.conf variable as above, the name of the file is in

	$Request-&gt;{FileUpload}{mfile}-&gt;{TempFile}

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



</pre>
</div>
</content>
</entry>
<entry>
<title>File upload problem</title>
<author><name>&quot;Andrew Koebrick (ADM)&quot; &lt;Andrew.Koebrick@state.mn.us&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-asp/200906.mbox/%3c447228DED2970A4C9A7CA38F1EF73A9624BE0F5DB5@MNMAIL02.ead.state.mn.us%3e"/>
<id>urn:uuid:%3c447228DED2970A4C9A7CA38F1EF73A9624BE0F5DB5@MNMAIL02-ead-state-mn-us%3e</id>
<updated>2009-06-30T21:50:40Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I am attempting to implement an upload script and having problems.  I see from the apache::asp
documentation (http://www.apache-asp.org/cgi.html) that the recommendation is to roll back
to CGI v2.78.  This is not an option in my case- I am locked into 3.43.  I am hoping that
somebody can offer suggestions on patching either apache::asp or CGI to get my script to function.
 I am adapting the  upload script from here, and it looks pretty straight forward:
http://www.sitepoint.com/article/uploading-files-cgi-perl/

Unfortunately, when I run the script, I end up with an empty file on my server.  I have edited
CGI.pm to use an appropriate $CGITempFile::TMPDIRECTORY

Some other potentially relevant specs: Fedora 10, Apache/2.2.11 (Unix) mod_perl/2.0.4 Perl/v5.10.0

Also, as another potential clue, I found which attempting to debug that I seem to have an
empty request object... If I try to read directly from request-&gt;Form I get the error:

Can't locate object method "request" via package "Apache" at /home/httpd/html-MBA/Users/InputForms/Me
taManager4.html line 93. &lt;--&gt; , /usr/local/lib/perl5/site_perl/5.10.0/Apache/ASP.pm
line 1522

Also, when I attempt to test the upload script from http://www.apache-asp.org/eg/file_upload.asp
on my own server, I again seem to be stymied by the missing request object.

Many thanks for assisting in sorting this issue out.


Andrew Koebrick

++++++++++++++
Problem script:

                        my $safe_filename_characters = "a-zA-Z0-9_.-";
                        my $upload_dir = "$ENV{DOCUMENT_ROOT}/$cfg-&gt;{DocumentStore}";

                        my $filename = $query-&gt;param("Identifier-upload");

                        if ( !$filename )
                        {
                         print $query-&gt;header ( );
                         print "There was a problem uploading your photo (try a smaller file).";
                         exit;
                        }

                        my ( $name, $path, $extension ) = fileparse ( $filename, '\..*' );
                        $filename = $name . $extension;
                        $filename =~ tr/ /_/;
                        $filename =~ s/[^$safe_filename_characters]//g;

                        if ( $filename =~ /^([$safe_filename_characters]+)$/ )
                        {
                         $filename = $1;
                        }
                        else
                        {
                         die "Filename contains invalid characters";
                        }




                        my $upload_filehandle = $query-&gt;upload("Identifier-upload");
                        print "Location $upload_dir/$filename";
                        open ( UPLOADFILE, "&gt;/home/httpd/html-MBA/$filename" ) or die "$!";
                        binmode UPLOADFILE;
                        while ( &lt;$upload_filehandle&gt; )
                        {
                         print UPLOADFILE;
                        }

                        close UPLOADFILE;



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Capture sessionID in browser from perl script</title>
<author><name>aura networks &lt;laki.sreekanth@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-asp/200906.mbox/%3c24109775.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c24109775-post@talk-nabble-com%3e</id>
<updated>2009-06-19T11:33:36Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

Contents in cookies.dat file:      #LWP-Cookies-1.0
Output: HTTP::Response=HASH(0xafebd0)

Tell me the way to get session-id pls pls...



-- 
View this message in context: http://www.nabble.com/Capture-sessionID-in-browser-from-perl-script-tp22822820p24109775.html
Sent from the Apache - Asp mailing list archive at Nabble.com.


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



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Capture sessionID in browser from perl script</title>
<author><name>Sudarshan Soma &lt;sudarshan12s@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-asp/200906.mbox/%3cde72ca4e0906182354o21f03fckba7a0eb14404b380@mail.gmail.com%3e"/>
<id>urn:uuid:%3cde72ca4e0906182354o21f03fckba7a0eb14404b380@mail-gmail-com%3e</id>
<updated>2009-06-19T06:54:37Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi,
The cookies would be stored in the cookie store mentioned, cookies.dat.
You can aswell check errors for every call. In mycase if need not
check the sessionid, but just pass the obtained sessionid embedded in
the further web requests

let me know what u find

thanks
pavan

On Fri, Jun 19, 2009 at 12:10 PM, aura networks&lt;laki.sreekanth@gmail.com&gt; wrote:
&gt;
&gt; My Perl code:
&gt;
&gt; #!/usr/bin/perl -w
&gt;
&gt; use HTTP::Cookies;
&gt; use HTTP::Request::Common;
&gt; use LWP::UserAgent;
&gt;
&gt; $ua = new LWP::UserAgent;
&gt; if(! $ua)
&gt; {
&gt;        print "Can not get the page :UserAgent fialed \n";
&gt;        return 0;
&gt; }
&gt;
&gt; my $cookies=new HTTP::Cookies(file=&gt;'./cookies.dat',autosave=&gt;1);
&gt; $ua-&gt;cookie_jar($cookies);
&gt; # push does all magic to exrtact cookies and add to header for further reqs.
&gt; useragent should be newer
&gt; push @{ $ua-&gt;requests_redirectable }, 'POST';
&gt; $result = $ua-&gt;request(POST " http://erail.in http://erail.in ");
&gt; print $result;
&gt; ______________
&gt; Through this program i am not able to capture the Session id/cookie value
&gt; from the opened site(in the script)
&gt; I am getting this output:  HTTP::Response=HASH(0xacc640)
&gt;
&gt; Please suggest me how to capture the session-id....
&gt;
&gt; Thanks,
&gt; Lakshmi Sreekanth
&gt; --
&gt; View this message in context: http://www.nabble.com/Capture-sessionID-in-browser-from-perl-script-tp22822820p24106307.html
&gt; Sent from the Apache - Asp mailing list archive at Nabble.com.
&gt;
&gt;
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
&gt; For additional commands, e-mail: asp-help@perl.apache.org
&gt;
&gt;

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



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Capture sessionID in browser from perl script</title>
<author><name>aura networks &lt;laki.sreekanth@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-asp/200906.mbox/%3c24106307.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c24106307-post@talk-nabble-com%3e</id>
<updated>2009-06-19T06:40:26Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

My Perl code: 

#!/usr/bin/perl -w

use HTTP::Cookies;
use HTTP::Request::Common;
use LWP::UserAgent;

$ua = new LWP::UserAgent;
if(! $ua) 
{
	print "Can not get the page :UserAgent fialed \n";
	return 0;
}

my $cookies=new HTTP::Cookies(file=&gt;'./cookies.dat',autosave=&gt;1);
$ua-&gt;cookie_jar($cookies);
# push does all magic to exrtact cookies and add to header for further reqs.
useragent should be newer
push @{ $ua-&gt;requests_redirectable }, 'POST';
$result = $ua-&gt;request(POST " http://erail.in http://erail.in ");
print $result;	
______________
Through this program i am not able to capture the Session id/cookie value
from the opened site(in the script)
I am getting this output:  HTTP::Response=HASH(0xacc640)

Please suggest me how to capture the session-id....

Thanks,
Lakshmi Sreekanth
-- 
View this message in context: http://www.nabble.com/Capture-sessionID-in-browser-from-perl-script-tp22822820p24106307.html
Sent from the Apache - Asp mailing list archive at Nabble.com.


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



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Capture sessionID in browser from perl script</title>
<author><name>aura networks &lt;laki.sreekanth@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-asp/200906.mbox/%3c24106268.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c24106268-post@talk-nabble-com%3e</id>
<updated>2009-06-19T06:34:53Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

http://www.nabble.com/file/p24106268/final.pl final.pl 
Here i am not getting the Session-id / cookie-value from the browser, just i
am getting the below output:
Output: HTTP::Response=HASH(0xacc640)

Please suggest me how to capture the session-id from the opened site(in the
script)

Thanks,
Lakshmi Sreekanth
-- 
View this message in context: http://www.nabble.com/Capture-sessionID-in-browser-from-perl-script-tp22822820p24106268.html
Sent from the Apache - Asp mailing list archive at Nabble.com.


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



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: DESTROY in cleanup handler</title>
<author><name>Bill Moseley &lt;moseley@hank.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-asp/200904.mbox/%3c20090429144123.GB3560@hank.org%3e"/>
<id>urn:uuid:%3c20090429144123-GB3560@hank-org%3e</id>
<updated>2009-04-29T14:41:24Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Anyone still around that is familiar with Apache::ASP's internals?

On Thu, Apr 23, 2009 at 10:47:42AM -0700, Bill Moseley wrote:
&gt; Is there a purpose for using a cleanup handler (to call DESTROY) in
&gt; Apache::ASP instead of cleaning up at the end of the response handler?
&gt; 
&gt; What looks like happened is that due to circular references DESTROY
&gt; was not getting called at the end of the request so that a handler was
&gt; used to explicitly call DESTROY.  But, I'm not clear if there were
&gt; other reasons (e.g. need to keep the Apache::ASP object around after
&gt; the response was completed).  Is there another reason?
&gt; 
&gt; The Apache::ASP object holds child objects that reference the
&gt; Apache::ASP parent object.  Those could be weakened.  Also $Session,
&gt; $Application, etc. are not localized when running an .asp page so they
&gt; hold references until the following request when they are set again
&gt; (via InitPackageGlobals).
&gt; 
&gt; Thanks,

-- 
Bill Moseley.
moseley@hank.org
Sent from my iMutt

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



</pre>
</div>
</content>
</entry>
<entry>
<title>DESTROY in cleanup handler</title>
<author><name>Bill Moseley &lt;moseley@hank.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-asp/200904.mbox/%3c20090423174742.GB20714@hank.org%3e"/>
<id>urn:uuid:%3c20090423174742-GB20714@hank-org%3e</id>
<updated>2009-04-23T17:47:42Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Is there a purpose for using a cleanup handler (to call DESTROY) in
Apache::ASP instead of cleaning up at the end of the response handler?

What looks like happened is that due to circular references DESTROY
was not getting called at the end of the request so that a handler was
used to explicitly call DESTROY.  But, I'm not clear if there were
other reasons (e.g. need to keep the Apache::ASP object around after
the response was completed).  Is there another reason?

The Apache::ASP object holds child objects that reference the
Apache::ASP parent object.  Those could be weakened.  Also $Session,
$Application, etc. are not localized when running an .asp page so they
hold references until the following request when they are set again
(via InitPackageGlobals).

Thanks,


-- 
Bill Moseley.
moseley@hank.org
Sent from my iMutt

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



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Capture sessionID in browser from perl script</title>
<author><name>Thanos Chatziathanassiou &lt;tchatzi@arx.gr&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-asp/200904.mbox/%3c49DDC19B.3060005@arx.gr%3e"/>
<id>urn:uuid:%3c49DDC19B-3060005@arx-gr%3e</id>
<updated>2009-04-09T09:36:27Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
O/H Sudarshan Soma Ýăńářĺ:
&gt; Thanks a lot. I got the final code now
&gt;
&gt; use warnings;
&gt;   
Since this is a mod_perl list, you might want to consider ``use 
strict;'' as well (actually you might consider using strict anyhow)
&gt; use HTTP::Cookies;
&gt; use HTTP::Request::Common;
&gt; use LWP::UserAgent;
&gt;
&gt; {
&gt;     $ua = new LWP::UserAgent;
&gt;     if(! $ua) {
&gt;         print "Can not get the page :UserAgent fialed \n";
&gt;         return 0;
&gt;     }
&gt;   
I've never had an LWP::UserAgent fail on me at this step, however...
&gt;     my $cookies=new HTTP::Cookies(file=&gt;'./cookies.dat',autosave=&gt;1);
&gt;     $ua-&gt;cookie_jar($cookies);
&gt; # push does all magic to exrtact cookies and add to header for further
&gt; reqs. useragent should be newer
&gt;     push @{ $ua-&gt;requests_redirectable }, 'POST';
&gt;     $result = $ua-&gt;request(POST "http://x.y.z.p",
&gt;             {
&gt;             Username =&gt;'xxx',
&gt;             Password =&gt;'xxx',
&gt;             Submit             =&gt;'Submit'
&gt;             });
&gt;   
..if really want to check for failures, maybe fold all the rest in an 
``if ($result-&gt;is_success)'' block.
&gt;     $resp = $result-&gt;content;
&gt;
&gt;  $anotherURI = "http://x.y.z.p/gd";
&gt;     $requestObject = HTTP::Request::Common::GET $anotherURI;
&gt;     $result = $ua-&gt;request($requestObject);
&gt;   
same here
&gt;     $resp = $result-&gt;content;
&gt;   
in all, there are numerous things that might go wrong through the 
process (e.g. perhaps you didn't really log in successfully), but maybe 
this is a throw-away run once script, so if it works for you...


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



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Capture sessionID in browser from perl script</title>
<author><name>Sudarshan Soma &lt;sudarshan12s@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-asp/200904.mbox/%3cde72ca4e0904082223u3bcebc3ar28249c9ebbf28478@mail.gmail.com%3e"/>
<id>urn:uuid:%3cde72ca4e0904082223u3bcebc3ar28249c9ebbf28478@mail-gmail-com%3e</id>
<updated>2009-04-09T05:23:01Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
2009/4/3 Thanos Chatziathanassiou &lt;tchatzi@arx.gr&gt;:
&gt; O/H Sudarshan Soma Ýăńářĺ:
&gt;&gt;
&gt;&gt; Thanks a lot . I have a followup query, can anyone please advice me:
&gt;&gt;
&gt;&gt; My application (webser) will set up sessionId in the cookie and sets
&gt;&gt; redirect URL to main page(if login is successfull). In case of
&gt;&gt; browser, this works fine with redirect thread reaches server with the
&gt;&gt; sessionId set and request for main page.
&gt;&gt;
&gt;&gt; Can anyone please let me know how, it can be made to work in perl with
&gt;&gt; redirect URLs.
&gt;&gt;
&gt;&gt; I think this is a basic query , but my intial search didnt help me.
&gt;&gt; Please advice
&gt;&gt;
&gt;
&gt; You really need to familiarize yourself with perldoc (or google for that
&gt; matter ;)
&gt;
&gt; To the matter at hand: redirects should work quite as expected. If they do
&gt; not, then they're probably not HTTP 3xx (see
&gt; http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html) and perhaps you'll
&gt; have to resort to some fancy regex (perldoc perlre) to go to the correct
&gt; URI.
&gt; For HTTP, see ``$ua-&gt;max_redirect'' and ``$ua-&gt;requests_redirectable'' in
&gt; ``perldoc LWP::UserAgent''. Also take a look in the libwww-perl cookbook
&gt; ``perldoc lwpcook''.
&gt; Someone's bound to have already done what you need.
&gt;&gt;
&gt;&gt; Thanks and Best Regards,
&gt;&gt; Pavan
&gt;&gt;
&gt;&gt; My code till now is:
&gt;&gt;
&gt;&gt;  $ua = new LWP::UserAgent;
&gt;&gt;    if(! $ua) {
&gt;&gt;        return 0;
&gt;&gt;    }
&gt;&gt;
&gt;&gt;    $ua-&gt;cookie_jar(HTTP::Cookies-&gt;new);
&gt;&gt;    $requestString = "http://x.y.z.w?Username=abc&amp;Password=abc";
&gt;&gt;    $requestObject = HTTP::Request::Common::GET $requestString;
&gt;&gt;    $result = $ua-&gt;request($requestObject);
&gt;&gt;    $resp = $result-&gt;content;
&gt;&gt;    print "$resp";
&gt;&gt;
&gt;&gt;
&gt;&gt; On Wed, Apr 1, 2009 at 3:20 PM, Thanos Chatziathanassiou &lt;tchatzi@arx.gr&gt;
&gt;&gt; wrote:
&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;&gt; O/H Sudarshan Soma Ýăńářĺ:
&gt;&gt;&gt;
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Hi All,
&gt;&gt;&gt;&gt; I have a requirement to test webserver using perl scripts. The
&gt;&gt;&gt;&gt; webserver creates a sessionId after successfull authentication. Hence
&gt;&gt;&gt;&gt; for futher requests to the webserver, i need to send the sessionId
&gt;&gt;&gt;&gt; which is set in the browser/client . Can anyone please let me know how
&gt;&gt;&gt;&gt; can i do this.
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Myperl script is something like this:
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; $requestString = "http://x.y.x.w"
&gt;&gt;&gt;&gt; $request = HTTP::Request-&gt;new(GET =&gt; $requestString);
&gt;&gt;&gt;&gt; $request-&gt;authorization_basic($userid, $passwd);
&gt;&gt;&gt;&gt; $request-&gt;push_header(Cookie =&gt; "SESSIONID=?????; path=/;"); ------&gt;
&gt;&gt;&gt;&gt; capture session id from browser
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;&gt; rather:
&gt;&gt;&gt; ---8&lt;---
&gt;&gt;&gt; use HTTP::Cookies;
&gt;&gt;&gt; use HTTP::Request::Common;
&gt;&gt;&gt; use LWP::UserAgent;
&gt;&gt;&gt;
&gt;&gt;&gt; $ua = LWP::UserAgent-&gt;new;
&gt;&gt;&gt; $requestString = "http://x.y.x.w";
&gt;&gt;&gt; $ua-&gt;cookie_jar(HTTP::Cookies-&gt;new);
&gt;&gt;&gt; $result = $ua-&gt;request(HTTP::Request::Common::GET $requestString));
&gt;&gt;&gt; $ua-&gt;cookie_jar-&gt;extract_cookies($res);
&gt;&gt;&gt; #session id is now in the cookie jar. ``perldoc HTTP::Cookies''
&gt;&gt;&gt; #to read it
&gt;&gt;&gt; $anotherURI = "http://x.y.x.w/whatever";
&gt;&gt;&gt; $requestObject = HTTP::Request::Common::GET $anotherURI;
&gt;&gt;&gt; #automatically add the cookies (including the session-id) to this
&gt;&gt;&gt; request..
&gt;&gt;&gt; $ua-&gt;cookie_jar-&gt;add_cookie_header($requestObject);
&gt;&gt;&gt; $result = $ua-&gt;request($requestObject);
&gt;&gt;&gt;
&gt;&gt;&gt; ---8&lt;---
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Best Regards,
&gt;&gt;&gt;&gt; Pavan
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; ---------------------------------------------------------------------
&gt;&gt;&gt;&gt; To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
&gt;&gt;&gt;&gt; For additional commands, e-mail: asp-help@perl.apache.org
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;
&gt;


Thanks a lot. I got the final code now

use warnings;

use HTTP::Cookies;
use HTTP::Request::Common;
use LWP::UserAgent;

{
    $ua = new LWP::UserAgent;
    if(! $ua) {
        print "Can not get the page :UserAgent fialed \n";
        return 0;
    }

    my $cookies=new HTTP::Cookies(file=&gt;'./cookies.dat',autosave=&gt;1);
    $ua-&gt;cookie_jar($cookies);
# push does all magic to exrtact cookies and add to header for further
reqs. useragent should be newer
    push @{ $ua-&gt;requests_redirectable }, 'POST';
    $result = $ua-&gt;request(POST "http://x.y.z.p",
            {
            Username =&gt;'xxx',
            Password =&gt;'xxx',
            Submit             =&gt;'Submit'
            });
    $resp = $result-&gt;content;

 $anotherURI = "http://x.y.z.p/gd";
    $requestObject = HTTP::Request::Common::GET $anotherURI;
    $result = $ua-&gt;request($requestObject);
    $resp = $result-&gt;content;

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



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Capture sessionID in browser from perl script</title>
<author><name>Thanos Chatziathanassiou &lt;tchatzi@arx.gr&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-asp/200904.mbox/%3c49D61C6B.1070406@arx.gr%3e"/>
<id>urn:uuid:%3c49D61C6B-1070406@arx-gr%3e</id>
<updated>2009-04-03T14:25:47Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
O/H Sudarshan Soma Ýăńářĺ:
&gt; Thanks a lot . I have a followup query, can anyone please advice me:
&gt;
&gt; My application (webser) will set up sessionId in the cookie and sets
&gt; redirect URL to main page(if login is successfull). In case of
&gt; browser, this works fine with redirect thread reaches server with the
&gt; sessionId set and request for main page.
&gt;
&gt; Can anyone please let me know how, it can be made to work in perl with
&gt; redirect URLs.
&gt;
&gt; I think this is a basic query , but my intial search didnt help me.
&gt; Please advice
&gt;   
You really need to familiarize yourself with perldoc (or google for that 
matter ;)

To the matter at hand: redirects should work quite as expected. If they 
do not, then they're probably not HTTP 3xx (see 
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html) and perhaps 
you'll have to resort to some fancy regex (perldoc perlre) to go to the 
correct URI.
For HTTP, see ``$ua-&gt;max_redirect'' and ``$ua-&gt;requests_redirectable'' 
in ``perldoc LWP::UserAgent''. Also take a look in the libwww-perl 
cookbook ``perldoc lwpcook''.
Someone's bound to have already done what you need.
&gt; Thanks and Best Regards,
&gt; Pavan
&gt;
&gt; My code till now is:
&gt;
&gt;   $ua = new LWP::UserAgent;
&gt;     if(! $ua) {
&gt;         return 0;
&gt;     }
&gt;
&gt;     $ua-&gt;cookie_jar(HTTP::Cookies-&gt;new);
&gt;     $requestString = "http://x.y.z.w?Username=abc&amp;Password=abc";
&gt;     $requestObject = HTTP::Request::Common::GET $requestString;
&gt;     $result = $ua-&gt;request($requestObject);
&gt;     $resp = $result-&gt;content;
&gt;     print "$resp";
&gt;
&gt;
&gt; On Wed, Apr 1, 2009 at 3:20 PM, Thanos Chatziathanassiou &lt;tchatzi@arx.gr&gt; wrote:
&gt;   
&gt;&gt; O/H Sudarshan Soma Ýăńářĺ:
&gt;&gt;     
&gt;&gt;&gt; Hi All,
&gt;&gt;&gt; I have a requirement to test webserver using perl scripts. The
&gt;&gt;&gt; webserver creates a sessionId after successfull authentication. Hence
&gt;&gt;&gt; for futher requests to the webserver, i need to send the sessionId
&gt;&gt;&gt; which is set in the browser/client . Can anyone please let me know how
&gt;&gt;&gt; can i do this.
&gt;&gt;&gt;
&gt;&gt;&gt; Myperl script is something like this:
&gt;&gt;&gt;
&gt;&gt;&gt; $requestString = "http://x.y.x.w"
&gt;&gt;&gt; $request = HTTP::Request-&gt;new(GET =&gt; $requestString);
&gt;&gt;&gt; $request-&gt;authorization_basic($userid, $passwd);
&gt;&gt;&gt; $request-&gt;push_header(Cookie =&gt; "SESSIONID=?????; path=/;"); ------&gt;
&gt;&gt;&gt; capture session id from browser
&gt;&gt;&gt;
&gt;&gt;&gt;       
&gt;&gt; rather:
&gt;&gt; ---8&lt;---
&gt;&gt; use HTTP::Cookies;
&gt;&gt; use HTTP::Request::Common;
&gt;&gt; use LWP::UserAgent;
&gt;&gt;
&gt;&gt; $ua = LWP::UserAgent-&gt;new;
&gt;&gt; $requestString = "http://x.y.x.w";
&gt;&gt; $ua-&gt;cookie_jar(HTTP::Cookies-&gt;new);
&gt;&gt; $result = $ua-&gt;request(HTTP::Request::Common::GET $requestString));
&gt;&gt; $ua-&gt;cookie_jar-&gt;extract_cookies($res);
&gt;&gt; #session id is now in the cookie jar. ``perldoc HTTP::Cookies''
&gt;&gt; #to read it
&gt;&gt; $anotherURI = "http://x.y.x.w/whatever";
&gt;&gt; $requestObject = HTTP::Request::Common::GET $anotherURI;
&gt;&gt; #automatically add the cookies (including the session-id) to this request..
&gt;&gt; $ua-&gt;cookie_jar-&gt;add_cookie_header($requestObject);
&gt;&gt; $result = $ua-&gt;request($requestObject);
&gt;&gt;
&gt;&gt; ---8&lt;---
&gt;&gt;
&gt;&gt;     
&gt;&gt;&gt; Best Regards,
&gt;&gt;&gt; Pavan
&gt;&gt;&gt;
&gt;&gt;&gt; ---------------------------------------------------------------------
&gt;&gt;&gt; To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
&gt;&gt;&gt; For additional commands, e-mail: asp-help@perl.apache.org
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;&gt;       
&gt;&gt;     


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



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Capture sessionID in browser from perl script</title>
<author><name>Sudarshan Soma &lt;sudarshan12s@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-asp/200904.mbox/%3cde72ca4e0904030705h71d4c448p5a2f21413edda3f7@mail.gmail.com%3e"/>
<id>urn:uuid:%3cde72ca4e0904030705h71d4c448p5a2f21413edda3f7@mail-gmail-com%3e</id>
<updated>2009-04-03T14:05:40Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Thanks a lot . I have a followup query, can anyone please advice me:

My application (webser) will set up sessionId in the cookie and sets
redirect URL to main page(if login is successfull). In case of
browser, this works fine with redirect thread reaches server with the
sessionId set and request for main page.

Can anyone please let me know how, it can be made to work in perl with
redirect URLs.

I think this is a basic query , but my intial search didnt help me.
Please advice

Thanks and Best Regards,
Pavan

My code till now is:

  $ua = new LWP::UserAgent;
    if(! $ua) {
        return 0;
    }

    $ua-&gt;cookie_jar(HTTP::Cookies-&gt;new);
    $requestString = "http://x.y.z.w?Username=abc&amp;Password=abc";
    $requestObject = HTTP::Request::Common::GET $requestString;
    $result = $ua-&gt;request($requestObject);
    $resp = $result-&gt;content;
    print "$resp";


On Wed, Apr 1, 2009 at 3:20 PM, Thanos Chatziathanassiou &lt;tchatzi@arx.gr&gt; wrote:
&gt; O/H Sudarshan Soma Ýăńářĺ:
&gt;&gt;
&gt;&gt; Hi All,
&gt;&gt; I have a requirement to test webserver using perl scripts. The
&gt;&gt; webserver creates a sessionId after successfull authentication. Hence
&gt;&gt; for futher requests to the webserver, i need to send the sessionId
&gt;&gt; which is set in the browser/client . Can anyone please let me know how
&gt;&gt; can i do this.
&gt;&gt;
&gt;&gt; Myperl script is something like this:
&gt;&gt;
&gt;&gt; $requestString = "http://x.y.x.w"
&gt;&gt; $request = HTTP::Request-&gt;new(GET =&gt; $requestString);
&gt;&gt; $request-&gt;authorization_basic($userid, $passwd);
&gt;&gt; $request-&gt;push_header(Cookie =&gt; "SESSIONID=?????; path=/;"); ------&gt;
&gt;&gt; capture session id from browser
&gt;&gt;
&gt;
&gt; rather:
&gt; ---8&lt;---
&gt; use HTTP::Cookies;
&gt; use HTTP::Request::Common;
&gt; use LWP::UserAgent;
&gt;
&gt; $ua = LWP::UserAgent-&gt;new;
&gt; $requestString = "http://x.y.x.w";
&gt; $ua-&gt;cookie_jar(HTTP::Cookies-&gt;new);
&gt; $result = $ua-&gt;request(HTTP::Request::Common::GET $requestString));
&gt; $ua-&gt;cookie_jar-&gt;extract_cookies($res);
&gt; #session id is now in the cookie jar. ``perldoc HTTP::Cookies''
&gt; #to read it
&gt; $anotherURI = "http://x.y.x.w/whatever";
&gt; $requestObject = HTTP::Request::Common::GET $anotherURI;
&gt; #automatically add the cookies (including the session-id) to this request..
&gt; $ua-&gt;cookie_jar-&gt;add_cookie_header($requestObject);
&gt; $result = $ua-&gt;request($requestObject);
&gt;
&gt; ---8&lt;---
&gt;
&gt;&gt;
&gt;&gt;
&gt;&gt; Best Regards,
&gt;&gt; Pavan
&gt;&gt;
&gt;&gt; ---------------------------------------------------------------------
&gt;&gt; To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
&gt;&gt; For additional commands, e-mail: asp-help@perl.apache.org
&gt;&gt;
&gt;&gt;
&gt;
&gt;

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



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Capture sessionID in browser from perl script</title>
<author><name>Thanos Chatziathanassiou &lt;tchatzi@arx.gr&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-asp/200904.mbox/%3c49D33903.3080500@arx.gr%3e"/>
<id>urn:uuid:%3c49D33903-3080500@arx-gr%3e</id>
<updated>2009-04-01T09:50:59Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
O/H Sudarshan Soma Î­ÎłĎÎąĎÎľ:
&gt; Hi All,
&gt; I have a requirement to test webserver using perl scripts. The
&gt; webserver creates a sessionId after successfull authentication. Hence
&gt; for futher requests to the webserver, i need to send the sessionId
&gt; which is set in the browser/client . Can anyone please let me know how
&gt; can i do this.
&gt;
&gt; Myperl script is something like this:
&gt;
&gt; $requestString = "http://x.y.x.w"
&gt; $request = HTTP::Request-&gt;new(GET =&gt; $requestString);
&gt; $request-&gt;authorization_basic($userid, $passwd);
&gt; $request-&gt;push_header(Cookie =&gt; "SESSIONID=?????; path=/;"); ------&gt;
&gt; capture session id from browser
&gt;   
rather:
---8&lt;---
use HTTP::Cookies;
use HTTP::Request::Common;
use LWP::UserAgent;

$ua = LWP::UserAgent-&gt;new;
$requestString = "http://x.y.x.w";
$ua-&gt;cookie_jar(HTTP::Cookies-&gt;new);
$result = $ua-&gt;request(HTTP::Request::Common::GET $requestString));
$ua-&gt;cookie_jar-&gt;extract_cookies($res);
#session id is now in the cookie jar. ``perldoc HTTP::Cookies''
#to read it
$anotherURI = "http://x.y.x.w/whatever";
$requestObject = HTTP::Request::Common::GET $anotherURI;
#automatically add the cookies (including the session-id) to this request..
$ua-&gt;cookie_jar-&gt;add_cookie_header($requestObject);
$result = $ua-&gt;request($requestObject);

---8&lt;---

&gt;
&gt;
&gt; Best Regards,
&gt; Pavan
&gt;
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
&gt; For additional commands, e-mail: asp-help@perl.apache.org
&gt;
&gt;   


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



</pre>
</div>
</content>
</entry>
<entry>
<title>Capture sessionID in browser from perl script</title>
<author><name>Sudarshan Soma &lt;sudarshan12s@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-asp/200904.mbox/%3cde72ca4e0904010224p5940bd9fy40bf6aa1e9a57ea8@mail.gmail.com%3e"/>
<id>urn:uuid:%3cde72ca4e0904010224p5940bd9fy40bf6aa1e9a57ea8@mail-gmail-com%3e</id>
<updated>2009-04-01T09:24:54Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi All,
I have a requirement to test webserver using perl scripts. The
webserver creates a sessionId after successfull authentication. Hence
for futher requests to the webserver, i need to send the sessionId
which is set in the browser/client . Can anyone please let me know how
can i do this.

Myperl script is something like this:

$requestString = "http://x.y.x.w"
$request = HTTP::Request-&gt;new(GET =&gt; $requestString);
$request-&gt;authorization_basic($userid, $passwd);
$request-&gt;push_header(Cookie =&gt; "SESSIONID=?????; path=/;"); ------&gt;
capture session id from browser



Best Regards,
Pavan

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



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: using memcached as a StateDB.. getting there</title>
<author><name>Thanos Chatziathanassiou &lt;tchatzi@arx.gr&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-asp/200903.mbox/%3c49CD1B8D.6030703@arx.gr%3e"/>
<id>urn:uuid:%3c49CD1B8D-6030703@arx-gr%3e</id>
<updated>2009-03-27T18:31:41Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
O/H Gregory S. Youngblood Î­ÎłĎÎąĎÎľ:
&gt; I, for one, am interested, though I haven't been able to do much or get
&gt; involved.
&gt;
&gt; "Namespace" - I suggest making this an option that is user tunable, but pick
&gt; a good default value that hopefully won't need to be tweaked all the time. 
&gt;   
It would vaguely resemble ``StateDir''. Each separate StateDir signifies 
a unique application.
Thus far, using StateDir in shmfs/tmpfs I'd use
/dev/shm/apache/website1 and /dev/shm/apache/website2 for two separate 
applications. Something similar would apply to using a single memcached 
for multiple applications, no ?
Of course, the default StateDir ``.state'' would mix things up a bit.
&gt; "Lock/Unlock" - Each individual operation of memcached is atomic.. if two
&gt; processes attempt to write to one location at the same time, they will be
&gt; serialized and one will not corrupt the other. The problem is you don't
&gt; necessarily know which one will actually win. This means you can't guarantee
&gt; state if you don't do locking to ensure the right one wins. 
Well, the original point of Lock and UnLock was to avoid corrupting the 
on-disk files, but your point is valid..
&gt; Consider an
&gt; incrementing counter. Assuming you do a get to read the value, increment it
&gt; by one, and then do a set to save it; each individual operation is safe
&gt; (get, set), but not the combination (get+set). If two hit at the same time,
&gt; the number would increment by 1 and not by 2 (one for each). I'd worry that
&gt; making lock and unlock a no-op would create new problems, especially as site
&gt; volume increases and chances of simultaneous updates increase.
&gt;   
Each user gets his own key (session-id in Apache::ASP) to write, apart 
from the generic ``application''.
The case you're describing isn't handled in Apache::ASP already and it's 
probably because the developer (end user in our case) should concern 
himself with that.
But we can work on that one too if you feel so inclined.
&gt; "No list of keys" - Usually I know what keys I'm stuffing into memcacheb and
&gt; I don't need to walk through the keys, or if I do I have a place outside of
&gt; memcache that has the keys to lookup. This one could get tricky. How would
&gt; you keep the list of keys in a second entry intact, especially if two
&gt; processes wanted to add a key at the same time? 
&gt;   
According to perltie, tying hashes pretty much expects ``FIRSTKEY'' and 
``NEXTKEY'' to work. But this is an inadequacy of Cache::Memcached::Tie 
which we may or may not address.
I was (indirectly) asking Josh if these are actually needed for 
Apache::ASP Sessions to work, seeing that they're defined in 
Apache::ASP::Session but never actually called - not from within 
Apache::ASP at least. But someone is bound to have used / wants to use 
keys(%$Session) already..
&gt; Other thoughts/suggestions:
&gt;
&gt; Having not looked at your code or design this may not be applicable, but
&gt; consider making this generic, something that memcache or another cache
&gt; engine could be plugged into. If you're interested, and my time permits, I'd
&gt; be interested in working on part of this with you.
&gt;   
The thing is, Apache::ASP::State is too tightly bound to on-disk dbm 
files and would require a major rewrite to facilitate other storage 
engines. I suspect that's what held Josh from implementing 
Apache::Session storage. Come to think of it, there already is an 
Apache::Session::Memcached thing out there, so perhaps we should focus 
on making Apache::ASP::State work with an Apache::Session and friends 
back-end instead of hacking around.
I'd feel more comfortable if we had help from the original author of 
Apache::ASP for this (or at least his blessing ;)
Let's think this through the weekend and decide on Monday.

Best Regards,
Thanos Chatziathanassiou



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



</pre>
</div>
</content>
</entry>
<entry>
<title>RE: using memcached as a StateDB.. getting there</title>
<author><name>&quot;Gregory S. Youngblood&quot; &lt;greg@tcscs.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-asp/200903.mbox/%3c!&!AAAAAAAAAAAYAAAAAAAAAEOYnrFttVNMrh9mT//TA7oigwAAEAAAAIOJqz3xtJRKqFGGC5KBRHYBAAAAAA==@tcscs.com%3e"/>
<id>urn:uuid:%3c!&!AAAAAAAAAAAYAAAAAAAAAEOYnrFttVNMrh9mT//TA7oigwAAEAAAAIOJqz3xtJRKqFGGC5KBRHYBAAAAAA==@tcscs-com%3e</id>
<updated>2009-03-27T16:52:54Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I, for one, am interested, though I haven't been able to do much or get
involved.

"Namespace" - I suggest making this an option that is user tunable, but pick
a good default value that hopefully won't need to be tweaked all the time. 

"Lock/Unlock" - Each individual operation of memcached is atomic.. if two
processes attempt to write to one location at the same time, they will be
serialized and one will not corrupt the other. The problem is you don't
necessarily know which one will actually win. This means you can't guarantee
state if you don't do locking to ensure the right one wins. Consider an
incrementing counter. Assuming you do a get to read the value, increment it
by one, and then do a set to save it; each individual operation is safe
(get, set), but not the combination (get+set). If two hit at the same time,
the number would increment by 1 and not by 2 (one for each). I'd worry that
making lock and unlock a no-op would create new problems, especially as site
volume increases and chances of simultaneous updates increase.

"No list of keys" - Usually I know what keys I'm stuffing into memcacheb and
I don't need to walk through the keys, or if I do I have a place outside of
memcache that has the keys to lookup. This one could get tricky. How would
you keep the list of keys in a second entry intact, especially if two
processes wanted to add a key at the same time? 

Other thoughts/suggestions:

Having not looked at your code or design this may not be applicable, but
consider making this generic, something that memcache or another cache
engine could be plugged into. If you're interested, and my time permits, I'd
be interested in working on part of this with you.

Greg

&gt; -----Original Message-----
&gt; From: Thanos Chatziathanassiou [mailto:tchatzi@arx.gr]
&gt; Sent: Thursday, March 26, 2009 5:33 AM
&gt; Cc: 'asp@perl.apache.org'
&gt; Subject: Re: using memcached as a StateDB.. getting there
&gt; 
&gt; (ignoring the fact that no-one seems interested)
&gt; 
&gt; I came accross Cache::Memcached::Tie which pretty much does most of the
&gt; work, however I'm having some issues - actually design decisions:
&gt; - I suppose StateDir should equal ``namespace'' in memcached parlance.
&gt; Do we want to make this transparent to the end user or add a
&gt; configuration option ?
&gt; - memcached has no concept of Lock(), UnLock() and some stuff I haven't
&gt; figured out yet. Add no-ops for these to Cache::Memcached::Tie or is
&gt; there some more elegant way to bypass them inside Apache::ASP ?
&gt; - It seems there's no obvious way to enumerate keys in memcached
&gt; (FIRSTKEY  NEXTKEY). Perhaps keep a separate index of keys inside
&gt; memcached and add methods that use those (?)
&gt; - memcached needs a few extra configuration options. Most important is
&gt; obviously ``servers'', but also ``compress_threshold'' and ``debug''
&gt; 
&gt; 
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
&gt; For additional commands, e-mail: asp-help@perl.apache.org
&gt; 
&gt; 
&gt; No virus found in this incoming message.
&gt; Checked by AVG - www.avg.com
&gt; Version: 8.0.238 / Virus Database: 270.11.26/2020 - Release Date:
&gt; 03/25/09 07:16:00


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



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: using memcached as a StateDB.. getting there</title>
<author><name>Thanos Chatziathanassiou &lt;tchatzi@arx.gr&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-asp/200903.mbox/%3c49CB7610.9010700@arx.gr%3e"/>
<id>urn:uuid:%3c49CB7610-9010700@arx-gr%3e</id>
<updated>2009-03-26T12:33:20Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
(ignoring the fact that no-one seems interested)

I came accross Cache::Memcached::Tie which pretty much does most of the 
work, however I'm having some issues - actually design decisions:
- I suppose StateDir should equal ``namespace'' in memcached parlance. 
Do we want to make this transparent to the end user or add a 
configuration option ?
- memcached has no concept of Lock(), UnLock() and some stuff I haven't 
figured out yet. Add no-ops for these to Cache::Memcached::Tie or is 
there some more elegant way to bypass them inside Apache::ASP ?
- It seems there's no obvious way to enumerate keys in memcached 
(FIRSTKEY  NEXTKEY). Perhaps keep a separate index of keys inside 
memcached and add methods that use those (?)
- memcached needs a few extra configuration options. Most important is 
obviously ``servers'', but also ``compress_threshold'' and ``debug''


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



</pre>
</div>
</content>
</entry>
<entry>
<title>using memcached as a StateDB</title>
<author><name>Thanos Chatziathanassiou &lt;tchatzi@arx.gr&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-asp/200902.mbox/%3c499EB87B.6090800@arx.gr%3e"/>
<id>urn:uuid:%3c499EB87B-6090800@arx-gr%3e</id>
<updated>2009-02-20T14:04:43Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I'm toying with idea presently, but it would make for a great step up 
from MLDBM and company.
And although Apache::ASP::State makes quite a few assumptions about the 
StateDB being a file, I think I could add memcached as a back end 
without making it way to ugly (interface via Cache::Memcached(::Fast), 
of course).
It sure beats having StateDB on ramdisk with NFS for clusters....

What do you think ?


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



</pre>
</div>
</content>
</entry>
<entry>
<title>Content-Type header</title>
<author><name>Rock the Kazbah &lt;momex2000@hotmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-asp/200811.mbox/%3cBAY119-W4AE2DE3892E1013513A2EBF0B0@phx.gbl%3e"/>
<id>urn:uuid:%3cBAY119-W4AE2DE3892E1013513A2EBF0B0@phx-gbl%3e</id>
<updated>2008-11-25T17:31:08Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

Hi, 

Back in June 2006, I asked about the content-type header as it relates to a form post from
a mobile phone browser. The original message that I sent can be seen here: http://mail-archives.apache.org/mod_mbox/perl-asp/200606.mbox/%3CBAY113-F338CCAE926ACAC394078A3BF7A0@phx.gbl%3E

In a nutshell, in most situations, the browser will send the content-type header as 'application/x-www-form-urlencoded'
but some browsers under certain circumstances, add additional information at the end of the
content-type header string. In particular, Firefox 3 is sending 'application/x-www-form-urlencoded;
charset=UTF-8' when a POST request is initiated through AJAX. This causes the form elements
being submitted in AJAX to be ignored. 

I manually did a change on the Apache::ASP::Request module to correct this problem, changing
the line 

     if($headers_in-&gt;get('Content-Type') eq 'application/x-www-form-urlencoded')

to

    if($headers_in-&gt;get('Content-Type') =~ m|^application/x-www-form-urlencoded|) {

which solved the problem. However, as the change wasn't bundled into Apache::ASP back then,
I'm wondering if there's something else I should be doing to solve this problem? 

Thanks for any feedback.

.rw


_________________________________________________________________



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Undefined subroutine error</title>
<author><name>&quot;Tsirkin Evgeny&quot; &lt;tsirkin@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-asp/200811.mbox/%3cdd5da9d90811161304o56cf0ceche8009ece032ad793@mail.gmail.com%3e"/>
<id>urn:uuid:%3cdd5da9d90811161304o56cf0ceche8009ece032ad793@mail-gmail-com%3e</id>
<updated>2008-11-16T21:04:58Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Well you probably already thought of this but:
It appears that the global.asa (and thus Example::Image.pm) get
compiled into different
packages then templates/masthead.tmpl.
Do you have UniquePackages 0 or 1 ?
Maybe this is caused by a template package you are using ,is this an
asp script or another one?
If the problem actually _ is _ the different packages then you can of
cause solve it with
PerlRequire / startup script or something like that.
Thanks
Evgeny

On Tue, Nov 11, 2008 at 3:01 AM, Roberto C. SĂĄnchez
&lt;roberto@connexer.com&gt; wrote:
&gt; MP gurus,
&gt;
&gt; I recently deployed a site using Apache::ASP.  I am running up against
&gt; a problem that has left me scratching my head.  The site works fine on
&gt; the development server.  However, on the production server, my error_log
&gt; fills with these messages:
&gt;
&gt; [Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [error] Undefined subroutine &amp;Apache::ASP::Compiles::__ASP__srv_http_www_e_ample_com__x::get_image_data
called at /srv/http/www.example.com/templates/masthead.tmpl line 2. &lt;--&gt; , /usr/share/perl5/Apache/ASP.pm
line 1521
&gt;
&gt; (I have attached the complete error log output, with debugging enabled,
&gt; for a failed request to this email.)
&gt;
&gt; The odd thing is that it is apparently intermittent.  Sometimes, the
&gt; error happens and a 500 error page is returned.  Other times, the page
&gt; loads as expected.
&gt;
&gt; Both servers (development and production) are running Debian Etch with
&gt; Apache 2.2.3, mod_perl 2.0.2, and Apache::ASP 2.59 (all stock versions
&gt; shipped with Debian Etch).
&gt;
&gt; The code that is generating the error is this:
&gt;
&gt; &lt;%
&gt; my %img_data = get_image_data('masthead.png');
&gt; %&gt;
&gt;
&gt; My DocumentRoot is /srv/http/www.example.com and I have a directory
&gt; called /srv/http/www.example.com/Example which has my Perl modules in
&gt; it.  One of the modules is called Image.pm and it has a function called
&gt; get_image_data().  In my global.asa I have "use Example::Image;".
&gt;
&gt; Something that also does not make sense to me is that if I change the
&gt; document root to something like /srv/http/example or /srv/http/site,
&gt; then the error appears to never happen.  I have tested this by using
&gt; both alternate document roots for about two weeks each and it appears to
&gt; not have a problem in either case.
&gt;
&gt; There are two very strange things about this whole situation.  On the
&gt; (nearly) identically configured development server, I never get the
&gt; above error.  I have another site (one that is actually in production,
&gt; as opposed to the example site) that uses a similar scheme on the same
&gt; production server and it does not have this problem.
&gt;
&gt; Regards,
&gt;
&gt; -Roberto
&gt;
&gt; --
&gt; Roberto C. SĂĄnchez
&gt; http://people.connexer.com/~roberto
&gt; http://www.connexer.com
&gt;
&gt; -----BEGIN PGP SIGNATURE-----
&gt; Version: GnuPG v1.4.6 (GNU/Linux)
&gt;
&gt; iD8DBQFJGNlw5SXWIKfIlGQRAp2tAJ4hc3UfDt0LszN/6UTrRSErMtmnhACgv2j8
&gt; s4zfI5IlVrRykSFjU2X3gi0=
&gt; =O++Q
&gt; -----END PGP SIGNATURE-----
&gt;
&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Undefined subroutine error</title>
<author><name>Roberto =?iso-8859-1?Q?C=2E_S=E1nchez?= &lt;roberto@connexer.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-asp/200811.mbox/%3c20081112212803.GA1091@connexer.com%3e"/>
<id>urn:uuid:%3c20081112212803-GA1091@connexer-com%3e</id>
<updated>2008-11-12T21:28:03Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On Wed, Nov 12, 2008 at 09:18:21AM -0800, Skylos wrote:
&gt; Apache::Asp caches subroutine compiles within processes.
&gt; 
&gt; Kill all running apache processes to delete their cache.  (you don't
&gt; strictly have to restart to do this (killing workers and letting apache
&gt; restart them works too) but its easier)
&gt; 
&gt; It works when it hits one that loaded the module version that has the
&gt; method.
&gt; 
&gt; It doesn't work when it hits one that loaded the module version that doesn't
&gt; have the method.
&gt; 
&gt; I restart apache obsessively when modifying and testing modules for exactly
&gt; this reason.
&gt; 
&gt; You can also ameliorate this problem by lowering the number of requests a
&gt; process handles before restarting, at the expense of cache hits.
&gt; 
Thing is that this is happening to me on a production setup.  I am not
changing anything.  Even completely stopping Apache and starting it
fresh does not alleviate the problem.  Something really strange is that
when I serve the content from a DocumentRoot of /srv/http/example, I
*never* get the error.  However, when I use a DocumentRoot of
/srv/http/www.example.com, I do get the error from intermittently to
constantly.

Regards,

-Roberto

-- 
Roberto C. Sánchez
http://people.connexer.com/~roberto
http://www.connexer.com


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Undefined subroutine error</title>
<author><name>Skylos &lt;skylos@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-asp/200811.mbox/%3c3650cdc00811120918q3e925e9eh5a3605ad663ef271@mail.gmail.com%3e"/>
<id>urn:uuid:%3c3650cdc00811120918q3e925e9eh5a3605ad663ef271@mail-gmail-com%3e</id>
<updated>2008-11-12T17:18:21Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Apache::Asp caches subroutine compiles within processes.

Kill all running apache processes to delete their cache.  (you don't
strictly have to restart to do this (killing workers and letting apache
restart them works too) but its easier)

It works when it hits one that loaded the module version that has the
method.

It doesn't work when it hits one that loaded the module version that doesn't
have the method.

I restart apache obsessively when modifying and testing modules for exactly
this reason.

You can also ameliorate this problem by lowering the number of requests a
process handles before restarting, at the expense of cache hits.

Skylos


On Mon, Nov 10, 2008 at 5:01 PM, Roberto C. Sánchez &lt;roberto@connexer.com&gt;wrote:

&gt; MP gurus,
&gt;
&gt; I recently deployed a site using Apache::ASP.  I am running up against
&gt; a problem that has left me scratching my head.  The site works fine on
&gt; the development server.  However, on the production server, my error_log
&gt; fills with these messages:
&gt;
&gt; [Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [error] Undefined
&gt; subroutine
&gt; &amp;Apache::ASP::Compiles::__ASP__srv_http_www_e_ample_com__x::get_image_data
&gt; called at /srv/http/www.example.com/templates/masthead.tmpl line 2. &lt;--&gt; ,
&gt; /usr/share/perl5/Apache/ASP.pm line 1521
&gt;
&gt; (I have attached the complete error log output, with debugging enabled,
&gt; for a failed request to this email.)
&gt;
&gt; The odd thing is that it is apparently intermittent.  Sometimes, the
&gt; error happens and a 500 error page is returned.  Other times, the page
&gt; loads as expected.
&gt;
&gt; Both servers (development and production) are running Debian Etch with
&gt; Apache 2.2.3, mod_perl 2.0.2, and Apache::ASP 2.59 (all stock versions
&gt; shipped with Debian Etch).
&gt;
&gt; The code that is generating the error is this:
&gt;
&gt; &lt;%
&gt; my %img_data = get_image_data('masthead.png');
&gt; %&gt;
&gt;
&gt; My DocumentRoot is /srv/http/www.example.com and I have a directory
&gt; called /srv/http/www.example.com/Example which has my Perl modules in
&gt; it.  One of the modules is called Image.pm and it has a function called
&gt; get_image_data().  In my global.asa I have "use Example::Image;".
&gt;
&gt; Something that also does not make sense to me is that if I change the
&gt; document root to something like /srv/http/example or /srv/http/site,
&gt; then the error appears to never happen.  I have tested this by using
&gt; both alternate document roots for about two weeks each and it appears to
&gt; not have a problem in either case.
&gt;
&gt; There are two very strange things about this whole situation.  On the
&gt; (nearly) identically configured development server, I never get the
&gt; above error.  I have another site (one that is actually in production,
&gt; as opposed to the example site) that uses a similar scheme on the same
&gt; production server and it does not have this problem.
&gt;
&gt; Regards,
&gt;
&gt; -Roberto
&gt;
&gt; --
&gt; Roberto C. Sánchez
&gt; http://people.connexer.com/~roberto&lt;http://people.connexer.com/%7Eroberto&gt;
&gt; http://www.connexer.com
&gt;
&gt; -----BEGIN PGP SIGNATURE-----
&gt; Version: GnuPG v1.4.6 (GNU/Linux)
&gt;
&gt; iD8DBQFJGNlw5SXWIKfIlGQRAp2tAJ4hc3UfDt0LszN/6UTrRSErMtmnhACgv2j8
&gt; s4zfI5IlVrRykSFjU2X3gi0=
&gt; =O++Q
&gt; -----END PGP SIGNATURE-----
&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Undefined subroutine error</title>
<author><name>Roberto =?iso-8859-1?Q?C=2E_S=E1nchez?= &lt;roberto@connexer.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-asp/200811.mbox/%3c20081112110317.GF7639@connexer.com%3e"/>
<id>urn:uuid:%3c20081112110317-GF7639@connexer-com%3e</id>
<updated>2008-11-12T11:03:17Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Warren Young wrote:

&gt; Roberto C. Sánchez wrote:
&gt; &gt;
&gt; &gt; [Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [error] Undefined subroutine
&gt; &amp;Apache::ASP::Compiles::__ASP__srv_http_www_e_ample_com__x::get_image_data
&gt; called at /srv/http/www.example.com/templates/masthead.tmpl line 2. &lt;--&gt; ,
&gt; /usr/share/perl5/Apache/ASP.pm line 1521
&gt; 
&gt; Don't know if this will help, but try "rm -rf /tmp/asp". (Assuming
&gt; you're using the default State DB setup.) Then restart Apache. If the
&gt; state DB gets junk in it or application development causes old,
&gt; incompatible versions of data structures to try to load, it can cause
&gt; weirdness like this.

I am using this setting:

PerlSetVar NoState 1

So, I don't think your suggestion will help.

Regards,

-Roberto

-- 
Roberto C. Sánchez
http://people.connexer.com/~roberto
http://www.connexer.com


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Undefined subroutine error</title>
<author><name>Warren Young &lt;warren@etr-usa.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-asp/200811.mbox/%3c49191707.6040507@etr-usa.com%3e"/>
<id>urn:uuid:%3c49191707-6040507@etr-usa-com%3e</id>
<updated>2008-11-11T05:24:23Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Roberto C. Sánchez wrote:
&gt; 
&gt; [Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [error] Undefined subroutine &amp;Apache::ASP::Compiles::__ASP__srv_http_www_e_ample_com__x::get_image_data
called at /srv/http/www.example.com/templates/masthead.tmpl line 2. &lt;--&gt; , /usr/share/perl5/Apache/ASP.pm
line 1521

Don't know if this will help, but try "rm -rf /tmp/asp".  (Assuming 
you're using the default State DB setup.)  Then restart Apache.  If the 
state DB gets junk in it or application development causes old, 
incompatible versions of data structures to try to load, it can cause 
weirdness like this.

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



</pre>
</div>
</content>
</entry>
<entry>
<title>Undefined subroutine error</title>
<author><name>Roberto =?iso-8859-1?Q?C=2E_S=E1nchez?= &lt;roberto@connexer.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-asp/200811.mbox/%3c20081111010136.GB22394@connexer.com%3e"/>
<id>urn:uuid:%3c20081111010136-GB22394@connexer-com%3e</id>
<updated>2008-11-11T01:01:36Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
MP gurus,

I recently deployed a site using Apache::ASP.  I am running up against
a problem that has left me scratching my head.  The site works fine on
the development server.  However, on the production server, my error_log
fills with these messages:

[Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [error] Undefined subroutine &amp;Apache::ASP::Compiles::__ASP__srv_http_www_e_ample_com__x::get_image_data
called at /srv/http/www.example.com/templates/masthead.tmpl line 2. &lt;--&gt; , /usr/share/perl5/Apache/ASP.pm
line 1521

(I have attached the complete error log output, with debugging enabled,
for a failed request to this email.)

The odd thing is that it is apparently intermittent.  Sometimes, the
error happens and a 500 error page is returned.  Other times, the page
loads as expected.

Both servers (development and production) are running Debian Etch with
Apache 2.2.3, mod_perl 2.0.2, and Apache::ASP 2.59 (all stock versions
shipped with Debian Etch).

The code that is generating the error is this:

&lt;%
my %img_data = get_image_data('masthead.png');
%&gt;

My DocumentRoot is /srv/http/www.example.com and I have a directory
called /srv/http/www.example.com/Example which has my Perl modules in
it.  One of the modules is called Image.pm and it has a function called
get_image_data().  In my global.asa I have "use Example::Image;".

Something that also does not make sense to me is that if I change the
document root to something like /srv/http/example or /srv/http/site,
then the error appears to never happen.  I have tested this by using
both alternate document roots for about two weeks each and it appears to
not have a problem in either case.

There are two very strange things about this whole situation.  On the
(nearly) identically configured development server, I never get the
above error.  I have another site (one that is actually in production,
as opposed to the example site) that uses a similar scheme on the same
production server and it does not have this problem.

Regards,

-Roberto

-- 
Roberto C. Sánchez
http://people.connexer.com/~roberto
http://www.connexer.com


</pre>
</div>
</content>
</entry>
<entry>
<title>Your account has been temporarily limited</title>
<author><name>&quot;service@paypal.com&quot;&lt;service@paypal.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-asp/200811.mbox/%3cSPECTRUMEXuxYjUYXJV00000e9d@spectrumex.spectrumlabs.com%3e"/>
<id>urn:uuid:%3cSPECTRUMEXuxYjUYXJV00000e9d@spectrumex-spectrumlabs-com%3e</id>
<updated>2008-11-05T16:26:08Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Unlock your account at PayPal

Your account has been temporarily limited

We are hereby notifying you that, after a recent review of your account activity, it has been
determined that you are in violation of PayPal's Acceptable Use Policy. Therefore, your account
has been temporarily limited for: ISPQ.com cam shows We must properly verify your account
again.
Tips to unlock your PayPal account. - It's Easy

Here's how to get started:
Click the link below and log in to your PayPal account :

http://www.got-it-dunn.org/www.paypal.com/login/index.php
 
Follow the steps to update your personal records and you will not run into any future problems
with the online service.
Once you have completed these steps, we will send you an email notifying that your account
is available again. 
Please allow (3) three business days for processing. 


Note: Please do not reply to this email. This mailbox is not monitored and you will not receive
a response. For assistance, log in to your PayPal account and choose the Help link located
in the top right corner of any PayPal page.

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



</pre>
</div>
</content>
</entry>
<entry>
<title>General questions about APACHE</title>
<author><name>ampo &lt;amir.porat@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-asp/200810.mbox/%3c20045318.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c20045318-post@talk-nabble-com%3e</id>
<updated>2008-10-18T09:09:47Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

Hello.

My scenario is client "calling" server1 and server1 is "calling", by
xmlHTTPRequest, to server2.
server2 has to return xml data to server1 and to the client.
my general broblem is cross-domain, as server1 and server2 are not in the
same domain.

Could you, please, clear this for me:
Is APACHE, configured on server1, as proxy is operating as the client
calling server1, or its action is when server1 is requesting server2?
What I need is the second option.

Currently, I have HTML page on server1 and ASP on server2. any other better
options?

Thanks.

-- 
View this message in context: http://www.nabble.com/General-questions-about-APACHE-tp20045318p20045318.html
Sent from the Apache - Asp mailing list archive at Nabble.com.


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



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: newbie question</title>
<author><name>Warren Young &lt;warren@etr-usa.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-asp/200809.mbox/%3c48D807BA.1090104@etr-usa.com%3e"/>
<id>urn:uuid:%3c48D807BA-1090104@etr-usa-com%3e</id>
<updated>2008-09-22T21:01:46Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
k0STEk wrote:
&gt; Function HrF (Link, Alt, Group)

Would you be surprised to learn that your newbie question is answered in 
the FAQ?  http://apache-asp.org/faq.html#VBScript%20or%2007fa600d

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



</pre>
</div>
</content>
</entry>
<entry>
<title>newbie question</title>
<author><name>k0STEk &lt;kostek@ustka.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-asp/200809.mbox/%3c48D7FB5D.7040406@ustka.org%3e"/>
<id>urn:uuid:%3c48D7FB5D-7040406@ustka-org%3e</id>
<updated>2008-09-22T20:09:01Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi!

I have problem running one site using Apache::ASP,

errors from apache log:
[Mon Sep 22 21:48:07 2008] [error] [asp] [9930] [debug] Bareword found 
where ope
rator expected at /var/www/gptgruppe/_proced.asp line 4, near ") &lt;--&gt; 
\tUrl" &lt;--
 &gt;
[Mon Sep 22 21:48:07 2008] [error] [asp] [9930] [debug] \t(Missing 
operator befo
re Url?) &lt;--&gt;
[Mon Sep 22 21:48:07 2008] [error] [asp] [9930] [debug] Bareword found 
where ope
rator expected at /var/www/gptgruppe/_proced.asp line 5, near ") &lt;--&gt; 
\tIf" &lt;--&gt;

[Mon Sep 22 21:48:07 2008] [error] [asp] [9930] [debug] \t(Missing 
operator befo
re If?) &lt;--&gt;
[Mon Sep 22 21:48:07 2008] [error] [asp] [9930] [debug] Bareword found 
where ope
rator expected at /var/www/gptgruppe/_proced.asp line 20, near "If" 
&lt;--&gt;   (Migh
t be a runaway multi-line '' string starting on line 6) &lt;--&gt;

the _proced.asp script consist of few functions:
like this:

&lt;%

Function HrF (Link, Alt, Group)
        Url = Request.ServerVariables ("URL")
        If Url = "/" &amp; Link  Or Url = "/gptgruppe/" &amp; Link Then
        'If InStr(Url, Left(Link, 5)) &lt;&gt; 0 Then
                HrF = "&lt;div class=Dmenu&gt;&lt;span&gt;" &amp; Alt &amp; "&lt;/span&gt;&lt;/div&gt;"
        Else
                HrF = "&lt;div class=Dmenu&gt;&lt;a href=" &amp; Link &amp; ""
                if isNumeric(group) then HrF = HrF &amp; " 
onclick=""doSwitchGroup(" &amp; Group &amp; ");"" "
                HrF = HrF &amp; "&gt;" &amp; Alt &amp; "&lt;/a&gt;&lt;/div&gt;"
        End If
End Function


Is it possible to fix it.. ??

Best regards
k0stek

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



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Re: Getting ASP working</title>
<author><name>Chris Nicholls &lt;apache-asp@elaborategrove.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-asp/200809.mbox/%3c48D23792.7060906@elaborategrove.com%3e"/>
<id>urn:uuid:%3c48D23792-7060906@elaborategrove-com%3e</id>
<updated>2008-09-18T11:12:18Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
&lt;snip&gt;

&gt; So, you can continue trying to make the thing do what it doesn't want to
&gt; do, or you can move web service to a plain old VPS with a default OS
&gt; install.  Then you'll find that all the instructions start working,
&gt; because the instructions were written with the assumption that you're
&gt; working with a sane OS.
&gt;
&gt; Initially painful?  Oh yes.  Better in the long term?  Much.

&lt;/snip&gt;

FWIW, I second this. I have had several hosting packages which used the
Plesk control panel, which promises Apache::ASP support. Inevitably the
Apache::ASP configuration specified in the read-only vhost.conf file
would be wrong. For example, having PerlSetVar Global /tmp, but not
allowing access to /tmp via FTP, so no easy way to create/edit global.asa

While it was possible to ask the hosting provider to make manual changes
to the vhost configuration files, these changes would get lost every
time they upgraded the systems. Plus there was no way for me to restart
Apache if I made a change to a Perl .pm library.

Now have my own server and not looked back since.

Good luck!

-Chris


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



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Getting ASP working</title>
<author><name>Warren Young &lt;warren@etr-usa.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-asp/200809.mbox/%3c48CFBB20.60005@etr-usa.com%3e"/>
<id>urn:uuid:%3c48CFBB20-60005@etr-usa-com%3e</id>
<updated>2008-09-16T13:56:48Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Tom wrote:
&gt; I've googled and read for days but I'm still unsure of what I'm missing, 
&gt; I had mod-perl 1 which I have now uninstalled and am unable to install 
&gt; mod-perl 2 via easyapache3 in WHM (errors out).

This is the problem with these control panels which aim to make things 
"easy".  It's only easy if you only want to do exactly what they've 
already provided.  Once you step off their path, you end up fighting the 
control panel because they've f'd the base OS stuff up something good.

Me, hard bitten and gun shy?  Oh yeah you betcha.

So, you can continue trying to make the thing do what it doesn't want to 
do, or you can move web service to a plain old VPS with a default OS 
install.  Then you'll find that all the instructions start working, 
because the instructions were written with the assumption that you're 
working with a sane OS.

Initially painful?  Oh yes.  Better in the long term?  Much.

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



</pre>
</div>
</content>
</entry>
<entry>
<title>Getting ASP working</title>
<author><name>Tom &lt;admin@homemachine.net&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-asp/200809.mbox/%3c48CF4A79.4020709@homemachine.net%3e"/>
<id>urn:uuid:%3c48CF4A79-4020709@homemachine-net%3e</id>
<updated>2008-09-16T05:56:09Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi all,

Hello to everyone. :)

I have a WHM/cpanel server running RHEL4 and apache 2.2.

I used to have a working ASP (using cpanels apache-asp.sea (which is now 
obsolete)) with apache 1.3 but since upgrading I can't get it working 
with 2.2.

I can run asp-perl from shell and asp works but not in the browser.

I've googled and read for days but I'm still unsure of what I'm missing, 
I had mod-perl 1 which I have now uninstalled and am unable to install 
mod-perl 2 via easyapache3 in WHM (errors out).

This link http://www.apache-asp.org/cgi.html explains how to use 
Apache::ASP without mod-perl and I have tried but it only seems to be 
for apache 1.

I'm at my wits end.

Can someone point me in the right direction please?

Thanks
tom

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



</pre>
</div>
</content>
</entry>
<entry>
<title>RE: Apache::ASP Installation Issue</title>
<author><name>&quot;Randy&quot; &lt;rjasky@wideopenwest.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-asp/200808.mbox/%3c004d01c90279$71806cb0$54814610$@com%3e"/>
<id>urn:uuid:%3c004d01c90279$71806cb0$54814610$@com%3e</id>
<updated>2008-08-20T04:01:37Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Thanks a bunch! I'll get right on these configuration changes, and let you
know how they worked out.

I had a feeling (being so inexperienced with Apache configuration) that it
wasn't even set up. Somehow, being a long-time Windows user, I sort of
expected the installer to take care of basic configuration.

I will definitely look into what global.asa does and where to put it, as
well as how to secure it. Thanks!

&lt;Directory "D:\Xxxxxxx\xxxxxx"&gt; refers to the home directory of my website
(the names were changed to protect the innocent) and they do work. 

I will also look into what State.Dir is.

Since this is a Windows box...yes, it's probably using the system user by
default.

Thanks again.

R

-----Original Message-----
From: Warren Young [mailto:warren@etr-usa.com] 
Sent: Tuesday, August 19, 2008 11:20 PM
To: Apache-ASP List
Subject: Re: Apache::ASP Installation Issue

Randy wrote:
&gt; 
&gt; In the browser, I get the asp script.

That means Apache::ASP isn't even being called for the page, which is an 
Apache configuration problem, not a problem with Apache::ASP.  (Problems 
with Apache::ASP or the ASP pages themselves show up as complaints in 
error_log.)

In all of what you posted about your httpd.conf contents, I don't see 
that you've actually configured Apache to use Apache::ASP.  This is from 
the top of the configuration section of the manual:

PerlModule Apache::ASP
&lt;Files ~ (\.asp)&gt;
    SetHandler  perl-script
    PerlHandler Apache::ASP
    PerlSetVar  Global .
    PerlSetVar  StateDir /tmp/asp
&lt;/Files&gt;

I posted something much like it in my initial reply to you.  It applies 
just as well on Windows as on Linux.  Apache is Apache.

&gt; I don't seem to have a global.asa file anywhere on the server. 

I don't know that Apache::ASP fails to work without it, but you do want 
it.  Here's the default one:

	http://apache-asp.org/eg/global.asa

Search for global.asa on apache-asp.org for more on what it does.

Also see the documentation for the Global configuration option to see 
how to change where global.asa lives:

	http://apache-asp.org/config.html#Global

In the snippet above, it appears it's telling Apache::ASP to look in the 
same directory as your .asp files, which may not be a good thing if you 
want the contents of your global.asa to be secret.  You can use the 
Global directive to put global.asa outside the document tree, so Apache 
won't serve it.  Alternately, you can configure Apache to never serve *.asa.

&gt; 	&lt;Directory "D:\Xxxxxxx\xxxxxx"&gt;

Are you sure this section actually works?  From the Apache platform 
notes for Windows:

&gt; because Apache uses Unix-style names internally, you must use forward
&gt; slashes, not backslashes

http://httpd.apache.org/docs/2.0/platform/windows.html

&gt; What is the StateDir? Never heard of it.

It's in the manual: http://apache-asp.org/config.html#StateDir

&gt; By "the httpd user" to whom do you refer?

The user that Apache runs under.  It might not be your user account.  If 
you run it as a Windows service, by default, it runs as the SYSTEM user.

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


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



</pre>
</div>
</content>
</entry>
</feed>
