Cliff Cogdill did a Perl version of the above Ruby snipped:
Code:
#!/usr/bin/perl
# Name: genXML.pl
# Author: Cliff Cogdill
# Date: 2010.07.08
# Purpose: This script will output an XML file of the data received from Men and Mice Central. In
# order to make this work, it must be placed in the "External Commands" section of the
# Men and Mice management console, which is only available to the Administrative user.
my $xmlLine, $outFile;
$outFile = "/opt/mms/scripts/central.xml";
$xmlLine = "";
# Create the output filehandle
open(OUT, ">$outFile") || die "Could not open " . $outFile;
# Read the input from STDIN and write it to the output file
while (<STDIN>) {
$xmlLine = $_;
print OUT $xmlLine . "\n";
}
# Close the output filehandle
close OUT;