home *** CD-ROM | disk | FTP | other *** search
- # $Id: Main.pl,v 1.1 1996/07/26 05:19:06 pedja Exp $
- # Main.pl: converted from the original Main.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
-
- package WO::Visitors::Main;
- use WOPerl;
-
- @IVARS=qw(number aName WOApp);
-
- # In an application or a component script, you can implement an awake
- # method to prepare the page and its variables for use during the
- # processing of the page. The awake method is the best place to
- # initialize variables whose values remain static for the page's
- # lifetime (such as a list of hyperlinks), or to modify variables
- # whose values only change when the page is first accessed. For
- # example, the following awake method increments the visitor count
- # each time a visitor accesses the page. The awake method is invoked
- # once per transaction.
-
- sub awake {
- my $self=shift;
- if (!$self->{'number'}) {
- $self->{'number'}=$WOApp->visitorNum+1;
- $WOApp->setVisitorNum($self->{'number'});
- }
- return $self;
- }
-
- # This method is invoked when the user presses Return or clicks the Submit
- # button. It assigns the value of aName to the global variable lastVisitor
- # and then clears the text field.
-
- sub recordMe
- {
- my $self=shift;
- if ($self->{'aName'}) {
- $WOApp->setLastVisitor($self->{'aName'});
- #print "name: ",$self->{'aName'},"\n";
- $self->{'aName'}="";
- }
- return;
- }
-
- 'WO::Visitors::Main';
- # EOF
-