home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!usc!news!netlabs!lwall
- From: lwall@netlabs.com (Larry Wall)
- Newsgroups: comp.lang.perl
- Subject: Re: BUG? in 4.035: length($`) is strange
- Message-ID: <1992Aug15.203554.10738@netlabs.com>
- Date: 15 Aug 92 20:35:54 GMT
- References: <1992Jul29.213032.11414@ugle.unit.no>
- Sender: news@netlabs.com
- Organization: NetLabs, Inc.
- Lines: 36
- Nntp-Posting-Host: scalpel.netlabs.com
-
- In article <1992Jul29.213032.11414@ugle.unit.no> harald.alvestrand@delab.sintef.no writes:
- : Environment: Sun-4, SunOS 4.1.1, cc used for compilation.
- : Also fails on HP-UX 8.0.whatever, HP-710 (different length, thou....)
- :
- :
- : ----------------- Cut here ------------------
- : #!/local/bin/perl
- : $_ = " 0049 56 | | | Standard Attribute List";
- : if (/Standard Attribute List/) {
- : $indent = length($`);
- : $var = $`;
- : $len = length($var);
- : print "Indent set to $indent, length of $`\n";
- : print "Len set to $len, length of $var\n";
- : }
- : --------------- Cut here -------------------
- :
- : Result of run with PERL version 4.0, patchlevel 35:
- :
- : Indent set to 475080, length of 0049 56 | | |
- : Len set to 22, length of 0049 56 | | |
- :
- : Result of run with PERL version 3.018:
- :
- : Indent set to 22, length of 0049 56 | | |
- : Len set to 22, length of 0049 56 | | |
- :
- : As you can see, I already have a workaround, but I do not like bugs....
- : can someone check if it is problematic in other versions, too?
-
- It's a bug in all versions from 4.009 to 4.035. It will not be a bug
- in future versions. If you want the "unofficial" fix, look in stab.c
- for the switch in function stab_len(), and move the return statement
- that's in the default: case to after the switch statement.
-
- Larry
-