#!/usr/bin/perl use warnings; use strict; use Data::Dumper; my $sgmfile= $ARGV[0]; my $key = ''; my $xline = ''; open (STDOUT, ">output.xml") or die $!; open (FILE, "<$sgmfile") or die "Can't open $sgmfile: $!\n"; my $line = ''; my %hash = (); my $hash = \%hash; my @tmpA = (); open (STDOUT, ">output.xml") or die $!; foreach $line () { chomp $line; if($line =~ m/