Global symbol "%message" requires explicit package name at C:/Perl/site/lib/LitLink/UserStuff.pm line 63. Global symbol "%message" requires explicit package name at C:/Perl/site/lib/LitLink/UserStuff.pm line 66. Compilation failed in require at (eval 1420) line 13. BEGIN failed--compilation aborted at (eval 1420) line 13.
print qq||; our $dbh; # "our" makes it a persistant global variable. BEGIN { $| = 1; # No output buffering. $ENV{PATH}=''; use strict; use DBI; use KET::PerlEx; use LitLink::Login; use LitLink::UserStuff; use LitLink::MessageCenter; use CGI; use Time::Local; # ReOpenDatabase allows for persistent connections. if (!ReOpenDatabase(\$dbh, "DBI:ODBC:newlitlink_edit")) { warn "ReOpenDatabase didn't work.\n"; exit 1; # Will trigger PerlEx to reload channel. } $dbh->{LongReadLen} = 16000; # This should give them more than enough. $dbh->{LongTruncOk} = 0; # We need to hear about this. } my $cgi = new CGI; my $content = ""; my $subject = "mc_test.aspl"; my $message_text = "this is the message text from mc_test.aspl"; my $preview_form = <<"EOF";

Message Preview

This is a preview of what your message will look like when delivered. Click "Continue" to continue with composition.

From: !!fname!! !!lname!!
To: (recipients)
Subject: !!subject!!
Date: !!now!!

!!message_text!!

Continue

EOF my $session_id = LitLink::Login::IsLoggedIn($cgi); if ($session_id) { # save data my $temp = LitLink::MessageCenter::NumberToText('7'); $content .= "7 is $temp
\n"; eval { my $result = LitLink::MessageCenter::SaveMessage($dbh, $session_id, '1', $subject, $message_text, undef, undef, undef, undef); $dbh->commit() if $result; my $now = now(); $content .= $preview_form; $content =~ s/!!fname!!/$fname/gi; $content =~ s/!!lname!!/$lname/gi; $content =~ s/!!subject!!/$subject/gi; $content =~ s/!!message_text!!/$message_text/gi; $content =~ s/!!now!!/$now/gi; }; if ($@) { $content .= $@; } } sub now { # Example: March 18, 2003 at 2:00 AM my ($sec, $min, $hour, $day, $month, $year, $wday, $yday, $isdst) = localtime(); my @short_months = qw/Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec/; my @long_months = qw/January February March April May June July August September October November December/; my @short_wdays = qw/Sun Mon Tue Wed Thu Fri Sat/; my @long_wdays = qw/Sunday Monday Tuesday Wednesday Thursday Friday Saturday/; $sec = sprintf("%02d",$sec); $min = sprintf("%02d",$min); $hour = sprintf("%02d",$hour); $day = sprintf("%02d",$day); $month = sprintf("%02d",$month); $year += 1900; my $txt_time = "$year-$month-$day $hour:$min:$sec"; return sprintf("%s %d, %d at %d:%s %s", $long_months[substr($txt_time, 5, 2)-1], substr($txt_time, 8, 2), substr($txt_time, 0, 4), ((substr($txt_time, 11, 2)-1) % 12)+1, substr($txt_time, 14, 2), substr($txt_time, 11, 5) gt '12:00' ? "PM" : "AM") } print qq| Message Center Testing Page Header Goes Here
|; print $content; print qq|
Page Footer Goes Here |;