freeswitch/libs/libtpl-1.5/lang/perl/tests/test18

24 lines
337 B
Perl
Executable File

#!/usr/bin/perl
#
use strict;
use warnings;
use lib "..";
use Tpl;
my $pwd = `pwd`;
chomp $pwd;
my $tmp1 = "$pwd/$0_1.out";
my @i=(1,2,3,4);
my $tpl = Tpl->tpl_map("i#",\@i, 3);
$tpl->tpl_pack(0);
$tpl->tpl_dump($tmp1);
my @j;
my $tpl2 = Tpl->tpl_map("i#",\@j,3);
$tpl2->tpl_load($tmp1);
$tpl2->tpl_unpack(0);
print "$_\n" for @j;