home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / perl / 4963 < prev    next >
Encoding:
Internet Message Format  |  1992-07-25  |  1.7 KB

  1. Path: sparky!uunet!gatech!pitt.edu!rm55
  2. From: rm55+@pitt.edu (Rudolph T Maceyko)
  3. Newsgroups: comp.lang.perl
  4. Subject: dosperl-4.035 problems
  5. Summary: broken?
  6. Keywords: dos perl-4.035 broken?
  7. Message-ID: <3772@blue.cis.pitt.edu.UUCP>
  8. Date: 26 Jul 92 02:59:40 GMT
  9. Sender: news+@pitt.edu
  10. Organization: University of Pittsburgh
  11. Lines: 69
  12.  
  13.  
  14. Has anyone had trouble with dosperl-4.035 (the DJGPP one found in
  15. ftp.umanitoba.ca:/pub/msdos/perl/perl386.zoo)?
  16.  
  17. It seems that one can only use formats that have the same name as the
  18. filehandle.  Any other setting of $~ results in no output.
  19.  
  20. The following test program fails doubly under this version of perl, but
  21. works on the previous (4.019, not DJGPP, also from ftp.umanitoba.ca):
  22.  
  23.  
  24. #!/usr/bin/perl
  25.  
  26. $a = 'apples';
  27. $b = 'banana';
  28. $c = 'cabins';
  29.  
  30. format STDOUT_1 =
  31. @<<<<<<< @<<<<<<< @<<<<<<<
  32. $a,      $b,      $c
  33. .
  34.  
  35. format STDOUT_2 =
  36. @>>>>>>> @>>>>>>> @>>>>>>>
  37. $c,      $b,      $a
  38. .
  39.  
  40. while (<>)
  41. {    $~ = ($. % 2) == 1 ? STDOUT_1 : STDOUT_2;
  42.     write;
  43. }
  44.  
  45. __END__
  46.  
  47.  
  48. The command:
  49.  
  50. D:\PERL2> perl test.pl
  51.  
  52. results in a new prompt.
  53.  
  54.  
  55. I don't use the "while (<>)" in any other script under DOS, so I first
  56. ran into its not working while running this test program.
  57.  
  58. When "while (<>)" is changed to "while (1)", there is no real output,
  59. just the newlines from my hitting return.
  60.  
  61.  
  62. Also,
  63.  
  64. D:\PERL2> perl -de 0
  65.  
  66. never prompts me for input, but it waits for it.  Again, all I see is the
  67. blank screen created by hitting return after return.  This might be caused
  68. by my still using the perl-4.019 perldb.pl.
  69.  
  70. I don't have these problems with perl-4.035 on any other platform.
  71.  
  72. And yes, I have set go32=emu d:\perl2\emu387.
  73.  
  74.  
  75. Thanks,
  76. Rudy
  77.  
  78. -- 
  79. Rudy Maceyko
  80. <rm55+@pitt.edu> or <rtm+@cmu.edu>
  81. Pittsburgh, Pennsylvania USA
  82.