|
|
Choosing A Webhost: |
Re: ModPerl2/Apache2 - Error handling return codes -RegistryCooker.pm:"Argu: msg#00193apache.mod-perl.devel
Hello Stan,
Nice mesg'g: A RegistryCooker.pm edit took and the server started fine - yet when I'm executing a cookie script (noted below) I'm gettting the "Dude, your just killed $r!(/var/www/sec/cooky)" .... Same with the other .pl's.
cooky.pl ----------------------------------------- #!/usr/bin/perl -w
use strict;
#use Test::Cookie; use CGI; use CGI::Cookie; use vars qw($q $switch $status $sessionID); init();
print_header(); print_status(); ### <-- subroutines --> ###
# the init code
########### sub init{ $q = new CGI; $switch = $q->param("switch") ? 1 : 0;
# try to retrieve the session ID
# fetch existing cookies my %cookies = CGI::Cookie->fetch; $sessionID = exists $cookies{'sessionID'} ? $cookies{'sessionID'}->value : ''; # 0 = not running, 1 = running
$status = $sessionID ? 1 : 0; # switch status if asked to
$status = ($status+1) % 2 if $switch; if ($status){
# preserve sessionID if exists or create a new one $sessionID ||= generate_sessionID() if $status; } else { # delete the sessionID $sessionID = ''; } } # end of sub init
#################
sub print_header{ # prepare a cookie my $c = CGI::Cookie->new ('-name' => 'sessionID', '-value' => $sessionID, '-expires' => '+1h'); print $q->header
(-type => 'text/html', -cookie => $c); } # end of sub print_header
# print the current Session status and a form to toggle the status ################# sub print_status{ print qq{<HTML><HEAD><TITLE>Cookie</TITLE></HEAD><BODY>};
# print status
print "<B>Status:</B> ", $status ? "Session is running with ID: $sessionID" : "No session is running"; # change status form my $button_label = $status ? "Stop" : "Start"; print qq{<HR> <FORM> <INPUT TYPE=SUBMIT NAME=switch VALUE=" $button_label "> </FORM> }; print qq{</BODY></HTML>};
} # end of sub print_status
# A dummy ID generator
# Replace with a real session ID generator ######################## sub generate_sessionID { return scalar localtime; } # end of sub generate_sessionID ----------------------------------------------------------------------------------------------------------------------
--- Adolph Torres
--- EarthLink: It's your Internet.
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: minimum supported httpd version, Geoffrey Young |
|---|---|
| Next by Date: | Re: ModPerl2/Apache2 - Error handling return codes -RegistryCooker.pm:"Argument""isn't numeric ...& bottom of web page say:OK the server encounteredaninternal....., Stas Bekman |
| Previous by Thread: | Re: ModPerl2/Apache2 - Error handling return codes -RegistryCooker.pm:"Argument"" isn't numeric ...& bottom of web page say:OK the server encounteredaninternal ....., Adolph Torres |
| Next by Thread: | Re: ModPerl2/Apache2 - Error handling return codes -RegistryCooker.pm:"Argument""isn't numeric ...& bottom of web page say:OK the server encounteredaninternal....., Stas Bekman |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |