test19 406 B

12345678910111213141516171819202122232425
  1. #!/usr/bin/perl
  2. #
  3. use strict;
  4. use warnings;
  5. use lib "..";
  6. use Tpl;
  7. my $pwd = `pwd`;
  8. chomp $pwd;
  9. my $tmp1 = "$pwd/$0_1.out";
  10. my @i=(1,2,3,4);
  11. my @j=(-1,-2,-3, -4);
  12. my $tpl = Tpl->tpl_map("i#i#",\@i, 3, \@j, 4);
  13. $tpl->tpl_pack(0);
  14. $tpl->tpl_dump($tmp1);
  15. my (@x,@y);
  16. my $tpl2 = Tpl->tpl_map("i#i#",\@x, 3, \@y, 4);
  17. $tpl2->tpl_load($tmp1);
  18. $tpl2->tpl_unpack(0);
  19. print "$_\n" for @x;
  20. print "$_\n" for @y;