[LON-CAPA-cvs] cvs: loncom /build lpml_parse.pl
harris41
lon-capa-cvs@mail.lon-capa.org
Mon, 08 Apr 2002 10:56:16 -0000
harris41 Mon Apr 8 06:56:16 2002 EDT
Modified files:
/loncom/build lpml_parse.pl
Log:
beautifying, fixing header
Index: loncom/build/lpml_parse.pl
diff -u loncom/build/lpml_parse.pl:1.42 loncom/build/lpml_parse.pl:1.43
--- loncom/build/lpml_parse.pl:1.42 Thu Mar 21 21:09:41 2002
+++ loncom/build/lpml_parse.pl Mon Apr 8 06:56:16 2002
@@ -1,11 +1,16 @@
#!/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
# lpml_parse.pl - Linux Packaging Markup Language parser
#
-# $Id: lpml_parse.pl,v 1.42 2002/03/22 02:09:41 harris41 Exp $
+# $Id: lpml_parse.pl,v 1.43 2002/04/08 10:56:16 harris41 Exp $
#
-# Written by Scott Harrison, harris41@msu.edu
+# Written by Scott Harrison, codeharrison@yahoo.com
#
# Copyright Michigan State University Board of Trustees
#
@@ -37,7 +42,8 @@
# 11/4,11/5,11/6,11/7,11/16,11/17 - Scott Harrison
# 12/2,12/3,12/4,12/5,12/6,12/13,12/19,12/29 - Scott Harrison
# YEAR=2002
-# 1/8,1/9,1/29,1/31,2/5,3/21 - Scott Harrison
+# 1/8,1/9,1/29,1/31,2/5,3/21,4/8 - Scott Harrison
+#
###
###############################################################################
@@ -57,7 +63,8 @@
#
# I am using a multiple pass-through approach to parsing
# the lpml file. This saves memory and makes sure the server
-# will never be overloaded.
+# will never be overloaded. At some point, I expect the
+# first two steps will be implemented with my XFML
#
# This is meant to parse files meeting the lpml document type.
# See lpml.dtd. LPML=Linux Packaging Markup Language.
@@ -83,7 +90,7 @@
# ------------------------------------------------- Grab command line arguments
-my $mode;
+my $mode='';
if (@ARGV==5) {
$mode = shift @ARGV;
}
@@ -94,20 +101,20 @@
exit -1; # exit with error status
}
-my $categorytype;
+my $categorytype='';
if (@ARGV) {
$categorytype = shift @ARGV;
}
-my $dist;
+my $dist='';
if (@ARGV) {
$dist = shift @ARGV;
}
-my $targetroot;
-my $sourceroot;
-my $targetrootarg;
-my $sourcerootarg;
+my $targetroot='';
+my $sourceroot='';
+my $targetrootarg='';
+my $sourcerootarg='';
if (@ARGV) {
$sourceroot = shift @ARGV;
}
@@ -137,7 +144,7 @@
# ---------------------------------------------------- Start first pass through
my @parsecontents = <>;
my $parsestring = join('',@parsecontents);
-my $outstring;
+my $outstring='';
# Need to make a pass through and figure out what defaults are
# overrided. Top-down overriding strategy (leaves don't know
@@ -151,7 +158,7 @@
die('can\'t create TokeParser object');
$parser->xml_mode('1');
my %hash;
-my $key;
+my $key='';
while ($token = $parser->get_token()) {
if ($token->[0] eq 'S') {
$hloc++;
@@ -172,9 +179,9 @@
}
# --------------------------------------------------- Start second pass through
-undef $hloc;
-undef @hierarchy;
-undef $parser;
+undef($hloc);
+undef(@hierarchy);
+undef($parser);
$hierarchy[0]=0;
$parser = HTML::TokeParser->new(\$parsestring) or
die('can\'t create TokeParser object');
@@ -1548,6 +1555,8 @@
# ----------------------------------- POD (plain old documentation, CPAN style)
+=pod
+
=head1 NAME
lpml_parse.pl - This is meant to parse files meeting the lpml document type.
@@ -1614,5 +1623,13 @@
=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