home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / perl / 5335 < prev    next >
Encoding:
Internet Message Format  |  1992-08-15  |  1.7 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!usc!news!netlabs!lwall
  2. From: lwall@netlabs.com (Larry Wall)
  3. Newsgroups: comp.lang.perl
  4. Subject: Re: BUG? in 4.035: length($`) is strange
  5. Message-ID: <1992Aug15.203554.10738@netlabs.com>
  6. Date: 15 Aug 92 20:35:54 GMT
  7. References: <1992Jul29.213032.11414@ugle.unit.no>
  8. Sender: news@netlabs.com
  9. Organization: NetLabs, Inc.
  10. Lines: 36
  11. Nntp-Posting-Host: scalpel.netlabs.com
  12.  
  13. In article <1992Jul29.213032.11414@ugle.unit.no> harald.alvestrand@delab.sintef.no writes:
  14. : Environment: Sun-4, SunOS 4.1.1, cc used for compilation.
  15. : Also fails on HP-UX 8.0.whatever, HP-710 (different length, thou....)
  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. : Result of run with PERL version 4.0, patchlevel 35:
  28. : Indent set to 475080, length of   0049    56 |  |  |  
  29. : Len set to 22, length of   0049    56 |  |  |  
  30. : Result of run with PERL version 3.018:
  31. : Indent set to 22, length of   0049    56 |  |  |  
  32. : Len set to 22, length of   0049    56 |  |  |  
  33. : As you can see, I already have a workaround, but I do not like bugs....
  34. : can someone check if it is problematic in other versions, too?
  35.  
  36. It's a bug in all versions from 4.009 to 4.035.  It will not be a bug
  37. in future versions.  If you want the "unofficial" fix, look in stab.c
  38. for the switch in function stab_len(), and move the return statement
  39. that's in the default: case to after the switch statement.
  40.  
  41. Larry
  42.