Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Excel::Template final XML file

by poj (Abbot)
on Dec 05, 2018 at 17:58 UTC ( [id://1226788]=note: print w/replies, xml ) Need Help??


in reply to Excel::Template final XML file

I've looked into the methods and could't find out.

Looking at the source, you should be able to access the tempfile name using $template->{tempfile}

#!/usr/bin/perl use strict; use Excel::Template::TT; # some TT options my $config = { INTERPOLATE => 1, EVAL_PERL => 1, }; # set variables for replacement my $vars = { host => { cmts => { name => 'name' }, interfaces => [ { bundle => 'bundle1', subBundle => 'subBundle1', secondaries => [ { ipAddress => '198.168.0.1', subnetMask => '255.255.255.0', },],},],}, }; # create object my $template = Excel::Template::TT->new( filename => 'sample.xml', config => $config, VARS => $vars, ); # xml template file created my $xml = $template->{tempfile}; open IN,'<',$xml or die "$!"; print $_ for <IN>; close IN; $template->write_file('sample.xls'); system('excel sample.xls')
poj

Replies are listed 'Best First'.
Re^2: Excel::Template final XML file
by llarochelle (Beadle) on Dec 05, 2018 at 18:20 UTC
    Hi poj, well I looked into the documentation ... I have to develop this reflex and look into the source code !

    This is great news, I tried that piece of code and it's working out perfectly

    Many thanks

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1226788]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-23 07:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found