Apache-ASP

 view release on metacpan or  search on metacpan

site/objects.html  view on Meta::CPAN

		</tr>
		
		<tr>
		
			<td valign=top >
			<font face="lucida console" size=-1>
			<a href=#%24Session-%3E%7BTf539b225>$Session->{Timeout} [= $minutes]</a>
			</font>
			</td>
		
			<td valign=top >
			<font face="lucida console" size=-1>
			<a href=#%24Request-%3E%7BT6acbcf5a>$Request->{TotalBytes}</a>
			</font>
			</td>
							
		</tr>
		
		<tr>
		
			<td valign=top >
			<font face="lucida console" size=-1>
			<a href=#%24Session-%3EAbc5f4cea0>$Session->Abandon()</a>
			</font>
			</td>
		
			<td valign=top >
			<font face="lucida console" size=-1>
			<a href=#%24Request-%3EBi2e1177cf>$Request->BinaryRead([$length])</a>
			</font>
			</td>
							
		</tr>
		
		<tr>
		
			<td valign=top >
			<font face="lucida console" size=-1>
			<a href=#%24Session-%3ELocc872f91>$Session->Lock()  </a>
			</font>
			</td>
		
			<td valign=top >
			<font face="lucida console" size=-1>
			<a href=#%24Request-%3ECled50cd44>$Request->ClientCertificate()</a>
			</font>
			</td>
							
		</tr>
		
		<tr>
		
			<td valign=top >
			<font face="lucida console" size=-1>
			<a href=#%24Session-%3EUnc1c1024f>$Session->UnLock()</a>
			</font>
			</td>
		
			<td valign=top >
			<font face="lucida console" size=-1>
			<a href=#%24Request-%3ECoe6d79e01>$Request->Cookies($name [,$key])</a>
			</font>
			</td>
							
		</tr>
		
		<tr>
		
			<td valign=top >
			<font face="lucida console" size=-1>
			
			</font>
			</td>
		
			<td valign=top >
			<font face="lucida console" size=-1>
			<a href=#%24Request-%3EFi6799fcec>$Request->FileUpload($form_field, $key)</a>
			</font>
			</td>
							
		</tr>
		
		<tr>
		
			<td valign=top bgcolor=#005196>
			<font face="lucida console" size=-1>
			<font color=white><b><a href=#%24Response%20Ob5268b3d4><font color=white>$Response Object</font></a></b></font>
			</font>
			</td>
		
			<td valign=top >
			<font face="lucida console" size=-1>
			<a href=#%24Request-%3EFo76659178>$Request->Form($name)</a>
			</font>
			</td>
							
		</tr>
		
		<tr>
		
			<td valign=top >
			<font face="lucida console" size=-1>
			<a href=#%24Response-%3E%7B4a870234>$Response->{BinaryRef}</a>
			</font>
			</td>
		
			<td valign=top >
			<font face="lucida console" size=-1>
			<a href=#%24Request-%3EPa455879ca>$Request->Params($name)</a>
			</font>
			</td>
							
		</tr>
		
		<tr>
		
			<td valign=top >
			<font face="lucida console" size=-1>
			<a href=#%24Response-%3E%7Ba1012197>$Response->{Buffer}</a>
			</font>
			</td>

site/objects.html  view on Meta::CPAN

			<td valign=top >
			<font face="lucida console" size=-1>
			<a href=#%24Server-%3ECre0144679e>$Server->CreateObject($program_id)</a>
			</font>
			</td>
							
		</tr>
		
		<tr>
		
			<td valign=top >
			<font face="lucida console" size=-1>
			<a href=#%24Response-%3EA1b47bb43>$Response->AppendToLog($message)</a>
			</font>
			</td>
		
			<td valign=top >
			<font face="lucida console" size=-1>
			<a href=#%24Server-%3EExec0fa247a>$Server->Execute($file, @args)</a>
			</font>
			</td>
							
		</tr>
		
		<tr>
		
			<td valign=top >
			<font face="lucida console" size=-1>
			<a href=#%24Response-%3EB202b8013>$Response->BinaryWrite($data)</a>
			</font>
			</td>
		
			<td valign=top >
			<font face="lucida console" size=-1>
			<a href=#%24Server-%3EFileaa99842>$Server->File()</a>
			</font>
			</td>
							
		</tr>
		
		<tr>
		
			<td valign=top >
			<font face="lucida console" size=-1>
			<a href=#%24Response-%3EC08958c05>$Response->Clear()</a>
			</font>
			</td>
		
			<td valign=top >
			<font face="lucida console" size=-1>
			<a href=#%24Server-%3EGetb3d1ac42>$Server->GetLastError()</a>
			</font>
			</td>
							
		</tr>
		
		<tr>
		
			<td valign=top >
			<font face="lucida console" size=-1>
			<a href=#%24Response-%3ECd77d06d7>$Response->Cookies($name, [$key,] $value)</a>
			</font>
			</td>
		
			<td valign=top >
			<font face="lucida console" size=-1>
			<a href=#%24Server-%3EHTMb165f10b>$Server->HTMLEncode( $string || \$string )</a>
			</font>
			</td>
							
		</tr>
		
		<tr>
		
			<td valign=top >
			<font face="lucida console" size=-1>
			<a href=#%24Response-%3EDe321f073>$Response->Debug(@args)</a>
			</font>
			</td>
		
			<td valign=top >
			<font face="lucida console" size=-1>
			<a href=#%24Server-%3EMapd3711f06>$Server->MapInclude($include)</a>
			</font>
			</td>
							
		</tr>
		
		<tr>
		
			<td valign=top >
			<font face="lucida console" size=-1>
			<a href=#%24Response-%3EE295b6523>$Response->End()</a>
			</font>
			</td>
		
			<td valign=top >
			<font face="lucida console" size=-1>
			<a href=#%24Server-%3EMap0fe1ebb5>$Server->MapPath($url);</a>
			</font>
			</td>
							
		</tr>
		
		<tr>
		
			<td valign=top >
			<font face="lucida console" size=-1>
			<a href=#%24Response-%3EE0139cee1>$Response->ErrorDocument($code, $uri)</a>
			</font>
			</td>
		
			<td valign=top >
			<font face="lucida console" size=-1>
			<a href=#%24Server-%3EMai03cc9918>$Server->Mail(\%mail, %smtp_args);</a>
			</font>
			</td>
							
		</tr>
		
		<tr>

site/objects.html  view on Meta::CPAN

	<a name=%24Response-%3E%7Bc48a3e9e></a>
	<font face=verdana><font class=title size=-1 color=#555555><b>$Response->{PICS}</b></font>
<font face="courier new" size=3><pre>
</pre></font>If this property has been set, a PICS-Label HTTP header will be
sent with its value.  For those that do not know, PICS is a header
that is useful in rating the internet.  It stands for 
Platform for Internet Content Selection, and you can find more
info about it at: <a href=http://www.w3.org>http://www.w3.org</a></font>
	
	<p>
	<a name=%24Response-%3E%7B7098f2f6></a>
	<font face=verdana><font class=title size=-1 color=#555555><b>$Response->{Status} = $status</b></font>
<font face="courier new" size=3><pre>
</pre></font>Sets the status code returned by the server.  Can be used to
set messages like 500, internal server error</font>
	
	<p>
	<a name=%24Response-%3EA8c17d8af></a>
	<font face=verdana><font class=title size=-1 color=#555555><b>$Response->AddHeader($name, $value)</b></font>
<font face="courier new" size=3><pre>
</pre></font>Adds a custom header to a web page.  Headers are sent only before any
text from the main page is sent, so if you want to set a header
after some text on a page, you must turn BufferingOn.</font>
	
	<p>
	<a name=%24Response-%3EA1b47bb43></a>
	<font face=verdana><font class=title size=-1 color=#555555><b>$Response->AppendToLog($message)</b></font>
<font face="courier new" size=3><pre>
</pre></font>Adds $message to the server log.  Useful for debugging.</font>
	
	<p>
	<a name=%24Response-%3EB202b8013></a>
	<font face=verdana><font class=title size=-1 color=#555555><b>$Response->BinaryWrite($data)</b></font>
<font face="courier new" size=3><pre>
</pre></font>Writes binary data to the client.  The only
difference from $Response-&gt;Write() is that $Response-&gt;Flush()
is called internally first, so the data cannot be parsed 
as an html header.  Flushing flushes the header if has not
already been written.
<font face="courier new" size=3><pre>
</pre></font>If you have set the $Response-&gt;{ContentType}
to something other than text/html, cgi header parsing (see <a href=cgi.html><font size=-1 face=verdana><b>CGI</b></font></a>
notes), will be automatically be turned off, so you will not
necessarily need to use BinaryWrite for writing binary data.
<font face="courier new" size=3><pre>
</pre></font>For an example of BinaryWrite, see the binary_write.htm example 
in <a href=eg/binary_write.htm>./site/eg/binary_write.htm</a>
<font face="courier new" size=3><pre>
</pre></font>Please note that if you are on Win32, you will need to 
call binmode on a file handle before reading, if 
its data is binary.</font>
	
	<p>
	<a name=%24Response-%3EC08958c05></a>
	<font face=verdana><font class=title size=-1 color=#555555><b>$Response->Clear()</b></font>
<font face="courier new" size=3><pre>
</pre></font>Erases buffered ASP output.</font>
	
	<p>
	<a name=%24Response-%3ECd77d06d7></a>
	<font face=verdana><font class=title size=-1 color=#555555><b>$Response->Cookies($name, [$key,] $value)</b></font>
<font face="courier new" size=3><pre>
</pre></font>Sets the key or attribute of cookie with name $name to the value $value.
If $key is not defined, the Value of the cookie is set.
ASP CookiePath is assumed to be / in these examples.
<font face="courier new" size=3><pre>
 $Response-&gt;Cookies(&#39;name&#39;, &#39;value&#39;); 
  --&gt; Set-Cookie: name=value; path=/

 $Response-&gt;Cookies(&quot;Test&quot;, &quot;data1&quot;, &quot;test value&quot;);     
 $Response-&gt;Cookies(&quot;Test&quot;, &quot;data2&quot;, &quot;more test&quot;);      
 $Response-&gt;Cookies(
	&quot;Test&quot;, &quot;Expires&quot;, 
	&amp;HTTP::Date::time2str(time+86400)
	); 
 $Response-&gt;Cookies(&quot;Test&quot;, &quot;Secure&quot;, 1);               
 $Response-&gt;Cookies(&quot;Test&quot;, &quot;Path&quot;, &quot;/&quot;);
 $Response-&gt;Cookies(&quot;Test&quot;, &quot;Domain&quot;, &quot;host.com&quot;);
  --&gt;	Set-Cookie:Test=data1=test%20value&amp;data2=more%20test;	\
 		expires=Fri, 23 Apr 1999 07:19:52 GMT;		\
 		path=/; domain=host.com; secure
</pre></font>The latter use of $key in the cookies not only sets cookie attributes
such as Expires, but also treats the cookie as a hash of key value pairs
which can later be accesses by
<font face="courier new" size=3><pre>
 $Request-&gt;Cookies(&#39;Test&#39;, &#39;data1&#39;);
 $Request-&gt;Cookies(&#39;Test&#39;, &#39;data2&#39;);
</pre></font>Because this is perl, you can (NOT PORTABLE) reference the cookies
directly through hash notation.  The same 5 commands above could be compressed to:
<font face="courier new" size=3><pre>
 $Response-&gt;{Cookies}{Test} = 
	{ 
		Secure	=&gt; 1, 
		Value	=&gt;	
			{
				data1 =&gt; &#39;test value&#39;, 
				data2 =&gt; &#39;more test&#39;
			},
		Expires	=&gt; 86400, # not portable, see above
		Domain	=&gt; &#39;host.com&#39;,
		Path    =&gt; &#39;/&#39;
	};
</pre></font>and the first command would be:
<font face="courier new" size=3><pre>
 # you don&#39;t need to use hash notation when you are only setting 
 # a simple value
 $Response-&gt;{Cookies}{&#39;Test Name&#39;} = &#39;Test Value&#39;; 
</pre></font>I prefer the hash notation for cookies, as this looks nice, and is 
quite perlish.  It is here to stay.  The Cookie() routine is 
very complex and does its best to allow access to the 
underlying hash structure of the data.  This is the best emulation 
I could write trying to match the Collections functionality of 
cookies in IIS ASP.
<font face="courier new" size=3><pre>
</pre></font>For more information on Cookies, please go to the source at
<a href=http://home.netscape.com/newsref/std/cookie_spec.html>http://home.netscape.com/newsref/std/cookie_spec.html</a></font>
	
	<p>
	<a name=%24Response-%3EDe321f073></a>
	<font face=verdana><font class=title size=-1 color=#555555><b>$Response->Debug(@args)</b></font>
<font face="courier new" size=3><pre>
</pre></font>API Extension. If the Debug config option is set greater than 0, 
this routine will write @args out to server error log.  refs in @args 
will be expanded one level deep, so data in simple data structures
like one-level hash refs and array refs will be displayed.  CODE
refs like
<font face="courier new" size=3><pre>
 $Response-&gt;Debug(sub { &quot;some value&quot; });
</pre></font>will be executed and their output added to the debug output.
This extension allows the user to tie directly into the
debugging capabilities of this module.
<font face="courier new" size=3><pre>
</pre></font>While developing an app on a production server, it is often 
useful to have a separate error log for the application
to catch debugging output separately.  One way of implementing 
this is to use the Apache ErrorLog configuration directive to 
create a separate error log for a virtual host. 
<font face="courier new" size=3><pre>
</pre></font>If you want further debugging support, like stack traces
in your code, consider doing things like:
<font face="courier new" size=3><pre>
 $Response-&gt;Debug( sub { Carp::longmess(&#39;debug trace&#39;) };
 $SIG{__WARN__} = \&amp;Carp::cluck; # then warn() will stack trace
</pre></font>The only way at present to see exactly where in your script
an error occurred is to set the Debug config directive to 2,
and match the error line number to perl script generated
from your ASP script.  
<font face="courier new" size=3><pre>
</pre></font>However, as of version 0.10, the perl script generated from the 
asp script should match almost exactly line by line, except in 
cases of inlined includes, which add to the text of the original script, 
pod comments which are entirely yanked out, and &lt;% # comment %&gt; style
comments which have a \n added to them so they still work.
<font face="courier new" size=3><pre>
</pre></font>If you would like to see the HTML preceding an error 
while developing, consider setting the BufferingOn 
config directive to 0.</font>
	
	<p>
	<a name=%24Response-%3EE295b6523></a>
	<font face=verdana><font class=title size=-1 color=#555555><b>$Response->End()</b></font>
<font face="courier new" size=3><pre>
</pre></font>Sends result to client, and immediately exits script.
Automatically called at end of script, if not already called.</font>
	
	<p>
	<a name=%24Response-%3EE0139cee1></a>
	<font face=verdana><font class=title size=-1 color=#555555><b>$Response->ErrorDocument($code, $uri)</b></font>
<font face="courier new" size=3><pre>
</pre></font>API extension that allows for the modification the Apache
ErrorDocument at runtime.  $uri may be a on site document,
off site URL, or string containing the error message.  
<font face="courier new" size=3><pre>
</pre></font>This extension is useful if you want to have scripts
set error codes with $Response-&gt;{Status} like 401

site/objects.html  view on Meta::CPAN

<font face="courier new" size=3><pre>
 $form = $Request-&gt;Form();
 for(keys %{$form}) {
	$Response-&gt;Write(&quot;$_: $form-&gt;{$_}&lt;br&gt;\n&quot;);
 }
</pre></font>Please see the <a href=eg/server_variables.htm>./site/eg/server_variables.htm</a> asp file for this 
method in action.
<font face="courier new" size=3><pre>
</pre></font>Note that if a form POST or query string contains duplicate
values for a key, those values will be returned through
normal use of the $Request object:
<font face="courier new" size=3><pre>
  @values = $Request-&gt;Form(&#39;key&#39;);
</pre></font>but you can also access the internal storage, which is
an array reference like so:
<font face="courier new" size=3><pre>
  $array_ref = $Request-&gt;{Form}{&#39;key&#39;};
  @values = @{$array_ref};
</pre></font>Please read the <a href=perlscript.html><font size=-1 face=verdana><b>PERLSCRIPT</b></font></a> section for more information 
on how things like $Request-&gt;QueryString() &amp; $Request-&gt;Form()
behave as collections.</font>
	
	<p>
	<a name=%24Request-%3E%7BM81641f4a></a>
	<font face=verdana><font class=title size=-1 color=#555555><b>$Request->{Method}</b></font>
<font face="courier new" size=3><pre>
</pre></font>API extension.  Returns the client HTTP request method, as in
GET or POST.  Added in version 2.31.</font>
	
	<p>
	<a name=%24Request-%3E%7BT6acbcf5a></a>
	<font face=verdana><font class=title size=-1 color=#555555><b>$Request->{TotalBytes}</b></font>
<font face="courier new" size=3><pre>
</pre></font>The amount of data sent by the client in the body of the 
request, usually the length of the form data.  This is
the same value as $Request-&gt;ServerVariables(&#39;CONTENT_LENGTH&#39;)</font>
	
	<p>
	<a name=%24Request-%3EBi2e1177cf></a>
	<font face=verdana><font class=title size=-1 color=#555555><b>$Request->BinaryRead([$length])</b></font>
<font face="courier new" size=3><pre>
</pre></font>Returns a string whose contents are the first $length bytes
of the form data, or body, sent by the client request.
If $length is not given, will return all of the form data.
This data is the raw data sent by the client, without any
parsing done on it by Apache::ASP.
<font face="courier new" size=3><pre>
</pre></font>Note that BinaryRead will not return any data for file uploads.
Please see the $Request-&gt;FileUpload() interface for access
to this data.  $Request-&gt;Form() data will also be available
as normal.</font>
	
	<p>
	<a name=%24Request-%3ECled50cd44></a>
	<font face=verdana><font class=title size=-1 color=#555555><b>$Request->ClientCertificate()</b></font>
<font face="courier new" size=3><pre>
</pre></font>Not implemented.</font>
	
	<p>
	<a name=%24Request-%3ECoe6d79e01></a>
	<font face=verdana><font class=title size=-1 color=#555555><b>$Request->Cookies($name [,$key])</b></font>
<font face="courier new" size=3><pre>
</pre></font>Returns the value of the Cookie with name $name.  If a $key is
specified, then a lookup will be done on the cookie as if it were
a query string.  So, a cookie set by:
<font face="courier new" size=3><pre>
 Set-Cookie: test=data1=1&amp;data2=2
</pre></font>would have a value of 2 returned by $Request-&gt;Cookies(&#39;test&#39;,&#39;data2&#39;).
<font face="courier new" size=3><pre>
</pre></font>If no name is specified, a hash will be returned of cookie names 
as keys and cookie values as values.  If the cookie value is a query string, 
it will automatically be parsed, and the value will be a hash reference to 
these values.
<font face="courier new" size=3><pre>
</pre></font>When in doubt, try it out.  Remember that unless you set the Expires
attribute of a cookie with $Response-&gt;Cookies(&#39;cookie&#39;, &#39;Expires&#39;, $xyz),
the cookies that you set will only last until you close your browser, 
so you may find your self opening &amp; closing your browser a lot when 
debugging cookies.
<font face="courier new" size=3><pre>
</pre></font>For more information on cookies in ASP, please read $Response-&gt;Cookies()</font>
	
	<p>
	<a name=%24Request-%3EFi6799fcec></a>
	<font face=verdana><font class=title size=-1 color=#555555><b>$Request->FileUpload($form_field, $key)</b></font>
<font face="courier new" size=3><pre>
</pre></font>API extension.  The FileUpload interface to file upload data is
stabilized.  The internal representation of the file uploads
is a hash of hashes, one hash per file upload found in 
the $Request-&gt;Form() collection.  This collection of collections
may be queried through the normal interface like so:
<font face="courier new" size=3><pre>
  $Request-&gt;FileUpload(&#39;upload_file&#39;, &#39;ContentType&#39;);
  $Request-&gt;FileUpload(&#39;upload_file&#39;, &#39;FileHandle&#39;);
  $Request-&gt;FileUpload(&#39;upload_file&#39;, &#39;BrowserFile&#39;);
  $Request-&gt;FileUpload(&#39;upload_file&#39;, &#39;Mime-Header&#39;);
  $Request-&gt;FileUpload(&#39;upload_file&#39;, &#39;TempFile&#39;);

  * note that TempFile must be use with the UploadTempFile 
    configuration setting.
</pre></font>The above represents the old slow collection interface, 
but like all collections in Apache::ASP, you can reference
the internal hash representation more easily.
<font face="courier new" size=3><pre>
  my $fileup = $Request-&gt;{FileUpload}{upload_file};
  $fileup-&gt;{ContentType};
  $fileup-&gt;{BrowserFile};
  $fileup-&gt;{FileHandle};
  $fileup-&gt;{Mime-Header};
  $fileup-&gt;{TempFile};
</pre></font>
	
	<p>
	<a name=%24Request-%3EFo76659178></a>
	<font face=verdana><font class=title size=-1 color=#555555><b>$Request->Form($name)</b></font>
<font face="courier new" size=3><pre>
</pre></font>Returns the value of the input of name $name used in a form
with POST method.  If $name is not specified, returns a ref to 
a hash of all the form data.  One can use this hash to 
create a nice alias to the form data like:
<font face="courier new" size=3><pre>
 # in global.asa
 use vars qw( $Form );
 sub Script_OnStart {
   $Form = $Request-&gt;Form;
 }
 # then in ASP scripts
 &lt;%= $Form-&gt;{var} %&gt;
</pre></font>File upload data will be loaded into $Request-&gt;Form(&#39;file_field&#39;), 
where the value is the actual file name of the file uploaded, and 
the contents of the file can be found by reading from the file
name as a file handle as in:
<font face="courier new" size=3><pre>
 while(read($Request-&gt;Form(&#39;file_field_name&#39;), $data, 1024)) {};
</pre></font>For more information, please see the <a href=cgi.html><font size=-1 face=verdana><b>CGI</b></font></a> / File Upload section,
as file uploads are implemented via the <a href=http://stein.cshl.org/WWW/software/CGI/cgi_docs.html><font size=-1 face=verdana><b>CGI.pm</b></font></a> module.  An
example can be found in the installation 
samples <a href=eg/file_upload.asp>./site/eg/file_upload.asp</a></font>
	
	<p>
	<a name=%24Request-%3EPa455879ca></a>



( run in 1.655 second using v1.01-cache-2.11-cpan-e1769b4cff6 )