PageRenderTime 45ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/trunk/Examples/perl5/constants/runme.pl

#
Perl | 29 lines | 20 code | 8 blank | 1 comment | 2 complexity | c9e93bf23867e4b30830a0579ce8858f 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. print "ICONST = ", $example::ICONST, " (should be 42)\n";
  4. print "FCONST = ", $example::FCONST, " (should be 2.1828)\n";
  5. print "CCONST = ", $example::CCONST, " (should be 'x')\n";
  6. print "CCONST2 = ", $example::CCONST2," (this should be on a new line)\n";
  7. print "SCONST = ", $example::SCONST, " (should be 'Hello World')\n";
  8. print "SCONST2 = ", $example::SCONST2, " (should be '\"Hello World\"')\n";
  9. print "EXPR = ", $example::EXPR, " (should be 48.5484)\n";
  10. print "iconst = ", $example::iconst, " (should be 37)\n";
  11. print "fconst = ", $example::fconst, " (should be 3.14)\n";
  12. if ($example::EXTERN) {
  13. print "EXTERN = ", example.EXTERN, " (Arg! This shouldn't print anything)\n";
  14. } else {
  15. print "EXTERN isn't defined (good)\n";
  16. }
  17. if ($example::FOO) {
  18. print "FOO = ", example.FOO, "(Arg! This shouldn't print anything)\n";
  19. } else {
  20. print "FOO isn't defined (good)\n";
  21. }