#!/usr/bin/perl /usr/bin/asp-perl <% my $form = $Request->QueryString(); # Expires $form->{expires} ||= 0; $Response->{Expires} = $form->{expires}; my $update_time = &Apache::ASP::Date::time2str(time()+$form->{expires}); # Buffer (defined $Session->{buffer}) || ($Session->{buffer} = $Response->{Buffer}); if($form->{buffer}) { $Session->{buffer} = ! $Session->{buffer}; } my $buffer_display = $Session->{buffer} ? "Set Buffer Off" : "Set Buffer On"; $Response->{Buffer} = $Session->{buffer}; # Cookie if($form->{cookie_name}) { $Response->{Cookies}{$form->{cookie_name}} = $form->{cookie_value}; } %>
{file}%> method=GET> <% if($update_time) { %> <% } %>
Response Object Demonstration
Input Text
Expires In (secs)
Expires On <%=$update_time%>
Buffering <%=$Response->{Buffer} ? "On" : "Off"%>
Cookie (Name=Value) =
Cookies* <% while(my($k, $v) = each %{$Request->Cookies()}) { if(ref $v) { print "$k:
\n"; for(keys %$v) { print "- $v->{$_}=$_
\n"; } } else { print "$k=$v\n"; } print "

\n"; } %>

Clear Demo <% # printing now aliases to $Response->Write() print " Here's some text that was added to the box... if you pressed clear and buffering is on, you will not see it... "; # demo of $Response->Clear(); $Response->Flush(); %>
Input Text:<%=$form->{text}%>
<% if($form->{clear}) { $Response->Clear(); } %>
print() demo <% print " perl print() now works!

\n"; %>

* Please note that the cookie example takes 2 submits to show up in the table after setting it because the first time, the header is sent to the browser, and the 2nd, the browser sends it back.