Hi, I generated latex template using perl,and complied with MikTeX, its genarating pdf.But I have some problems. I written script like this

#!/usr/bin/env perl use strict; use warnings; use XML::Fast; use Template; my $xml = <<'XML'; <student> <number>24</number> <education>bachelors</education> <specialization>computers </specialization> <address> <house_number="128"/> <street name="xxxx"/> <proddutoor/> </address> </student> <student> <number>23</number> <education>ph.d.</education> <specialization>physics </specialization> <address> <house_number="12"/> <street name="xxxx"/> <kadapa/> </address> </student> XML my $xml_hash = xml2hash $xml; my $template = Template->new(); my $filename = 'output.tex'; $template->process(\*DATA, $xml_hash, $filename) || die "Template process failed: ", $template->error(), "\n"; system( "pdflatex $filename" ); __DATA__ \documentclass{article} \title{Roster} \author{pavani} \begin{document} \maketitle [% FOREACH st IN student %] Student [% st.number %] is a [% st.specialization %] [% st.degree %] s +tudent and his address is[%address%][%house_number%][%street name%]. [% END %] \end{document}
when I run it its generating pdf with like this
student 24 is a computers student and his address is HASH(0x274b27c) student 23 is a computers student and his address is HASH(0x274b27c)
but I need to print address also how to get the address element content also like this
student 24 is a computers student and his address is house_number="128"; street name="xxxx"; proddutoor. student 23 is a computers student and his address is house_number="12"; street name="xxxx"; kadapa.
what should I need to change to print like this in pdf. 2)my second question is in my code i assigned only two students information to the variable $xml. But i have 150 students information in one file how can i print all students information in pdf. in this code i am printing only two students information. like this same format i have more number of stdents information in one file, I opened that file and assigned like this
my $file; open($file, 'formal.xml'); my $xml=$file; my $xml_hash = xml2hash $xml;
but its not working when i given a file as input.


In reply to errors in printing latex template output by veerubiji

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.