PageRenderTime 39ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/trunk/Examples/perl5/value/runme.pl

#
Perl | 38 lines | 26 code | 8 blank | 4 comment | 0 complexity | eeb419360c566adf563ac0b813f8ee6f MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. # file: runme.pl
  2. use example;
  3. # Create a couple of a vectors
  4. $v = example::new_Vector(1,2,3);
  5. $w = example::new_Vector(10,11,12);
  6. print "I just created the following vectors\n";
  7. example::vector_print($v);
  8. example::vector_print($w);
  9. # Now call some of our functions
  10. print "\nNow I'm going to compute the dot product\n";
  11. $d = example::dot_product($v,$w);
  12. print "dot product = $d (should be 68)\n";
  13. # Add the vectors together
  14. print "\nNow I'm going to add the vectors together\n";
  15. $r = example::vector_add($v,$w);
  16. example::vector_print($r);
  17. print "The value should be (11,13,15)\n";
  18. # Now I'd better clean up the return result r
  19. print "\nNow I'm going to clean up the return result\n";
  20. example::free($r);
  21. print "Good\n";