]> git.p6c8.net - selfforum.git/blobdiff - selfforum-cgi/shared/Posting/_lib.pm
fo_posting.pl now runs without warnings, it's yet too special, this will be fixed...
[selfforum.git] / selfforum-cgi / shared / Posting / _lib.pm
index f42ee992767c4e86a508a919c2d20d9081f4cd38..810f33443a5244665c16c755110201925c3e21da 100644 (file)
@@ -13,9 +13,6 @@ package Posting::_lib;
 
 use strict;
 
-use vars qw(@EXPORT_OK);
-use base qw(Exporter);
-
 use Encode::Plain; $Encode::Plain::utf8 = 1;
 
 use XML::DOM;
@@ -24,10 +21,19 @@ use XML::DOM;
 # Export
 # ====================================================
 
-@EXPORT_OK = qw(get_message_header get_message_body get_message_node get_body_node parse_single_thread parse_xml_file
-                hr_time short_hr_time long_hr_time
-                get_all_threads create_forum_xml_string
-                save_file);
+use constant SORT_ASCENT  => 0; # (young postings first)
+use constant SORT_DESCENT => 1;
+use constant KEEP_DELETED => 1;
+use constant KILL_DELETED => 0;
+
+use base qw(Exporter);
+@Posting::_lib::EXPORT_OK = qw(
+  get_message_header get_message_body get_message_node get_body_node parse_single_thread parse_xml_file
+  hr_time short_hr_time long_hr_time
+  get_all_threads create_forum_xml_string
+  save_file
+  SORT_ASCENT   SORT_DESCENT   KEEP_DELETED   KILL_DELETED
+);
 
 # ====================================================
 # Access via XML::DOM
@@ -151,7 +157,7 @@ sub get_message_node ($$$)
 sub parse_xml_file ($) {
   my $file = shift;
   my $xml = eval {
-              local $SIG{__DIE__};
+              local $SIG{__DIE__};      # CGI::Carp works unreliable ;-(
               new XML::DOM::Parser (KeepCDATA => 1) -> parsefile ($file);
             };
 

patrick-canterino.de