Thursday, November 15, 2012

That was fun. There's an instrument that takes an EDS file as an input. After some poking, I find that...

That was fun.



There's an instrument that takes an EDS file as an input. After some poking, I find that an EDS file is a ZIP file full of XML.



Most of the XML shouldn't have to change.



Some of the XML has to change to align with input.



I'm writing that XML with Template Toolkit because it's quicker to get to done than figuring out XML::LibXML or XML::TinyXML, and it's a very small set of things I want to change.



I'm working in a temp directory created by File::Temp. I'm writing the ZIP with IO::Compress::Zip. Right now, it writes based on the input and is fully accepted by the instrument software.



Now, I just need to store the right things in the DB and pull it out correctly.



Have I mentioned recently how much I love Perl? CPAN is a huge collection previously-invented wheels, and if I had to make up a way to do ZIP or templates or temp files or databases or XML myself, I'd still be elbow-deep. Thank you, Perl and the community behind you!




No comments:

Post a Comment