[LON-CAPA-cvs] cvs: loncom /build xfml_parse.pl
harris41
lon-capa-cvs@mail.lon-capa.org
Mon, 08 Apr 2002 10:52:24 -0000
harris41 Mon Apr 8 06:52:24 2002 EDT
Modified files:
/loncom/build xfml_parse.pl
Log:
fixing header information and some beautification; adding in POD
Index: loncom/build/xfml_parse.pl
diff -u loncom/build/xfml_parse.pl:1.3 loncom/build/xfml_parse.pl:1.4
--- loncom/build/xfml_parse.pl:1.3 Tue Feb 19 19:21:42 2002
+++ loncom/build/xfml_parse.pl Mon Apr 8 06:52:24 2002
@@ -1,7 +1,41 @@
#!/usr/bin/perl
+# -------------------------------------------------------- Documentation notice
+# Run "perldoc ./lpml_parse.pl" in order to best view the software
+# documentation internalized in this program.
+
+# --------------------------------------------------------- License Information
+# The LearningOnline Network with CAPA
+# piml_parse.pl - Linux Packaging Markup Language parser
+#
+# $Id: xfml_parse.pl,v 1.4 2002/04/08 10:52:24 harris41 Exp $
+#
+# Written by Scott Harrison, codeharrison@yahoo.com
+#
+# Copyright Michigan State University Board of Trustees
+#
+# This file is part of the LearningOnline Network with CAPA (LON-CAPA).
+#
+# LON-CAPA is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# LON-CAPA is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with LON-CAPA; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# /home/httpd/html/adm/gpl.txt
+#
+# http://www.lon-capa.org/
+#
# YEAR=2002
-# 1/26,1/27,1/28,1/29,1/30,1/31 - Scott Harrison
+# 1/26,1/27,1/28,1/29,1/30,1/31,2/20,4/8 - Scott Harrison
#
###
@@ -27,7 +61,7 @@
use strict;
unless (@ARGV) {
- print <<END;
+ print(<<END);
Incorrect invocation.
Example usages:
cat loncapafiles.lpml | perl xfml_parse.pl valid_hosts.xfml
@@ -39,7 +73,7 @@
# ---------------------------------------------- Read in filter file from @ARGV
my $tofilter=shift @ARGV;
-open IN,"<$tofilter"; my @lines=<IN>;
+open(IN,"<$tofilter"); my @lines=<IN>;
my $parsestring=join('',@lines); undef @lines; close IN;
my $parser = HTML::TokeParser->new(\$parsestring) or
die('can\'t create TokeParser object');
@@ -286,3 +320,69 @@
[@{$conditions{'cdata'}}];
return '';
}
+
+# ----------------------------------- POD (plain old documentation, CPAN style)
+
+=pod
+
+=head1 NAME
+
+xfml_parse.pl - This is meant to parse files meeting the xfml document type.
+See xfml.dtd. XFML=XML Filtering Markup Language.
+
+=head1 SYNOPSIS
+
+Usage is for lpml file to come in through standard input.
+
+=over 4
+
+=item *
+
+1st argument is name of xfml file.
+
+=back
+
+Example:
+
+ cat loncapafiles.lpml | perl xfml_parse.pl valid_hosts.xfml
+
+or
+
+ perl xfml_parse.pl valid_hosts.xfml loncapafiles.lpml
+
+=head1 DESCRIPTION
+
+I am using a multiple pass-through approach to parsing
+the xfml file. This saves memory and makes sure the server
+will never be overloaded.
+
+=head1 README
+
+I am using a multiple pass-through approach to parsing
+the xfml file. This saves memory and makes sure the server
+will never be overloaded.
+
+=head1 PREREQUISITES
+
+HTML::TokeParser
+
+=head1 COREQUISITES
+
+=head1 OSNAMES
+
+linux
+
+=head1 SCRIPT CATEGORIES
+
+Packaging/Administrative
+
+=head1 AUTHOR
+
+ Scott Harrison
+ codeharrison@yahoo.com
+
+Please let me know how/if you are finding this script useful and
+any/all suggestions. -Scott
+
+=cut
+