#use CGI (param); # CHANGE THIS TO... use CGI; my $q = CGI->new; my $cookie; # ADD THIS # CHANGE ALL param() TO $q->param() # ... my $pass = $q->param('pass'); # ... # Start security login. #&secure; # CHANGE THIS TO... if (not &check_secure) { &secure; } # must pass before going to main page # Subroutine selection. if ($add) { &add_link; } #.... # THIS IS FOR EXAMPLE ONLY - NOT SECURE sub check_secure { if ( $q->cookie('auth') eq 'some_secure_value') { return 1; } elsif ($pass eq $pwc) { $cookie = $q->cookie( -name=>'auth', -value=>"some_secure_value" ); return 1; } else { return 0; } } # NEED TO CHANGE header() FUNCTION TO SET COOKIE # Begin html header. sub header { if ($cookie) { print $q->header( -type => 'text/html', -expires => '+1d', -cookie => [$cookie] ); } else { print $q->header( -type => 'text/html', ); } #print "Content-type: text/html\n\n"; # NO NEED FOR THIS NOW print qq~ ... etc~; }