in reply to convert to XML
#!/usr/bin/perl use strict; print qq{<?xml version="1.0"?>\n}; my $tag; while(<DATA>) { chomp; if ( /^\[(\w+)\]/ ... /^\w+/ ) { $tag = $1 if $1; print "<$tag>$_</$tag>\n" if ( ! /^\[/ ); } } __DATA__ [DATA] data1 [ENTRY] entrying here [STORY] story details
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: convert to XML
by Anonymous Monk on Aug 13, 2009 at 04:55 UTC | |
by alexm (Chaplain) on Aug 13, 2009 at 15:35 UTC |