in reply to errors in printing latex template output
For your template code to work I suspect something like [%st.address.house_number%] could work (untested).
I assume with this line "my $xml=$file;" you somehow want to read in the file contents into $xml. Not gonna happen ;-). For reading from files usually the operator "<>" is used. Normally just like this: "my @xml=<$file>;" But since the documentation of XML::Fast doesn't say anything about xml2hash parameters, it is to be feared that arrays as input don't work. So you need this:
open($file, 'formal.xml'); { local $/; my $xml= <$file>; }
Similar code is easily found by googling for "perl read file into scalar". The important thing is the undefining of $/, the input record separator (see perlvar). Because of that line endings are not recognized when reading the file and the file contents is returned as one single variable instead of an array of lines.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: errors in printing latex template output
by veerubiji (Sexton) on Oct 24, 2011 at 08:35 UTC | |
by jethro (Monsignor) on Oct 24, 2011 at 09:17 UTC | |
by veerubiji (Sexton) on Oct 24, 2011 at 10:11 UTC | |
by jethro (Monsignor) on Oct 24, 2011 at 10:48 UTC |