home *** CD-ROM | disk | FTP | other *** search
- # $Id: Application.pl,v 1.1 1996/07/26 05:19:01 pedja Exp $
- # Application.pl: converted from the original Application.wos
- # The original file contains the following notice:
- #
- # You may freely copy, distribute, and reuse the code in this example.
- # NeXT disclaims any warranty of any kind, expressed or implied, as to its
- # fitness for any particular use.
- #
- # Written by Katie McCormick
- #
- # This application displays the name of the most recent visitor and the
- # total number of visitors to the page. The Application.wos script
- # declares two global variables: lastVisitor (which holds the name of the
- # most recent visitor), and visitorsNum (which holds the total number of
- # people who have visited the page since the application was launched).
- #
- # You can access global variables from any other script in an
- # application by sending a message to WOApp. For example, to set and
- # return the values of lastVisitor and visitorNum from another script,
- # you'd use the syntax:
- #
- # $WOApp->lastVisitor; # return lastVisitor
- # $WOApp->setLastVisitor($aValue); # set value of lastVisitor
- # $WOApp->visitorNum; # return visitorNum
- # $WOApp->setVisitorNum($aValue); # set value of visitorNum
- #
- # Note that these "accessor methods" aren't defined anywhere. In WOPerl,
- # you can access script variables with such accessor methods without having
- # to define them.
-
- package WO::Visitors;
- use WOPerl;
-
- @IVARS=qw(lastVisitor visitorNum);
- # lastVisitor: the most recent visitor
- # visitorNum: the total number of visitors the page
-
- sub awake
- {
- my $self=shift;
- # Obsolete sessions that have been inactive for more than 2 minutes
- $WOApp->setSessionTimeOut(120);
- $self->{'visitorNum'} = 0;
- }
-
- 'WO::Visitors';
- # EOF
-