home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / perl / os2perl / decl.t < prev    next >
Text File  |  1991-04-12  |  540b  |  50 lines

  1. #!./perl
  2.  
  3. # $Header: decl.t,v 4.0 91/03/20 01:50:09 lwall Locked $
  4.  
  5. # check to see if subroutine declarations work everwhere
  6.  
  7. sub one {
  8.     print "ok 1\n";
  9. }
  10. format one =
  11. ok 5
  12. .
  13.  
  14. print "1..7\n";
  15.  
  16. do one();
  17. do two();
  18.  
  19. sub two {
  20.     print "ok 2\n";
  21. }
  22. format two =
  23. @<<<
  24. $foo
  25. .
  26.  
  27. if ($x eq $x) {
  28.     sub three {
  29.     print "ok 3\n";
  30.     }
  31.     do three();
  32. }
  33.  
  34. do four();
  35. $~ = 'one';
  36. write;
  37. $~ = 'two';
  38. $foo = "ok 6";
  39. write;
  40. $~ = 'three';
  41. write;
  42.  
  43. format three =
  44. ok 7
  45. .
  46.  
  47. sub four {
  48.     print "ok 4\n";
  49. }
  50.