home *** CD-ROM | disk | FTP | other *** search
/ Borland Programmer's Resource / Borland_Programmers_Resource_CD_1995.iso / ntcode / ntperlb / t / op / magic.nt < prev    next >
Encoding:
Text File  |  1995-05-19  |  505 b   |  23 lines

  1. #!./perl
  2.  
  3. $| = 1;        # command buffering
  4.  
  5. print "1..3\n";
  6.  
  7. eval '$ENV{"foo"} = "hi there";';    # check that ENV is inited inside eval
  8. if (`echo %foo%` eq "hi there\n") {print "ok 1\n";} else {print "not ok 1\n";}
  9.  
  10. unlink 'ajslkdfpqjsjfk';
  11. $! = 0;
  12. open(foo,'ajslkdfpqjsjfk');
  13. if ($! == 22) {print "ok 2\n";} else {printf ("not ok 2# %d\n", $!);}
  14.  
  15. @val1 = @ENV{keys(%ENV)};    # can we slice ENV?
  16. @val2 = values(%ENV);
  17.  
  18. print join(':',@val1) eq join(':',@val2) ? "ok 3\n" : "not ok 3\n";
  19.  
  20.  
  21.  
  22.  
  23.