home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / perl / 5025 < prev    next >
Encoding:
Text File  |  1992-07-29  |  1.5 KB  |  45 lines

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!mcsun!sunic!ugle.unit.no!boheme.er.sintef.no!hta
  3. From: hta@boheme.er.sintef.no (Harald Tveit Alvestrand)
  4. Subject: BUG? in 4.035: length($`) is strange
  5. Message-ID: <1992Jul29.213032.11414@ugle.unit.no>
  6. Sender: news@ugle.unit.no (NetNews Administrator)
  7. Reply-To: harald.alvestrand@delab.sintef.no
  8. Organization: SINTEF DELAB, Norway
  9. Date: Wed, 29 Jul 92 21:30:32 GMT
  10. Lines: 33
  11.  
  12. Environment: Sun-4, SunOS 4.1.1, cc used for compilation.
  13. Also fails on HP-UX 8.0.whatever, HP-710 (different length, thou....)
  14.  
  15.  
  16. ----------------- Cut here ------------------
  17. #!/local/bin/perl
  18. $_ = "  0049    56 |  |  |  Standard Attribute List";
  19. if (/Standard Attribute List/) {
  20.    $indent = length($`);
  21.    $var = $`;
  22.    $len = length($var);
  23.    print "Indent set to $indent, length of $`\n";
  24.    print "Len set to $len, length of $var\n";
  25. }
  26. --------------- Cut here -------------------
  27.  
  28. Result of run with PERL version 4.0, patchlevel 35:
  29.  
  30. Indent set to 475080, length of   0049    56 |  |  |  
  31. Len set to 22, length of   0049    56 |  |  |  
  32.  
  33. Result of run with PERL version 3.018:
  34.  
  35. Indent set to 22, length of   0049    56 |  |  |  
  36. Len set to 22, length of   0049    56 |  |  |  
  37.  
  38. As you can see, I already have a workaround, but I do not like bugs....
  39. can someone check if it is problematic in other versions, too?
  40. -- 
  41.                    Harald Tveit Alvestrand
  42. Harald.Alvestrand@delab.sintef.no
  43. C=no;PRMD=uninett;O=sintef;OU=delab;S=alvestrand;G=harald
  44. +47 7 59 70 94
  45.