Category: | Utility Scripts |
Author/Contact Info | Intrepid |
Description: | Please use caution! I have found out from external sources that in XML, whitespace outside of tags can be significant, and that although the present version of PPM does not mind how my script changes <CITE>ppm.xml</CITE>, a future version may. It might be better, therefore, not to use this script. The Perl Package Manager (with ActivePerl) writes to a file named ppm.xml each time a module is installed using PPM. It doesn't add nice whitespace to the file, however, resulting in a mess if one ever needs to or wants to (out of curiosity) go in there and see what has happened before. This little (slightly "anal" :) utility script can be called from the very end of <CITE>PPM.bat</CITE> (another file that comes standard with the installation of ActivePerl) by adding the line: CALL fixPPMXMLfile to the file below the lines that match this:
at the end of the batchfile. This kicks off your cleaner which adds some whitespace to make more human-friendly a file which, it is to be admitted, is ordinarily only machine-read. |
#!perl -wi.bak # fixPPMXMLfile $ARGV[0] = 'D:/ActivePERL/site/lib/ppm.xml'; while ($line=<>) { $line =~ s#(</PACKAGE>)(<PACKAGE NAME=)#$1\n\n$2#; print $line; } ######################### # run `pl2bat' on this and: either place in your # PATH, or supply a full path specification when # you CALL it. ######################### |
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: ppm.xml made more human-friendly
by data64 (Chaplain) on Mar 31, 2001 at 06:37 UTC | |
by Intrepid (Deacon) on Apr 14, 2001 at 09:24 UTC | |
by idnopheq (Chaplain) on Apr 23, 2001 at 01:04 UTC |