Bug 119223
Summary: | perl length() doesn't work right with format writes | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 3 | Reporter: | erikj |
Component: | perl | Assignee: | Jason Vas Dias <jvdias> |
Status: | CLOSED NOTABUG | QA Contact: | |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 3.0 | CC: | pkesling |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | ia64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2005-11-10 18:47:08 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Red Hat Bugzilla
2004-03-26 17:43:08 UTC
I think this is perl bug 24767 http://rt.perl.org/rt3/index.html?q=24767 And the work around is to set this env variable before running perl. ie export LANG=en_US Very sorry for the long delay in processing this bug. I'm not sure what the "problem" is here. I don't think this bug has anything to do with perl bug 24767, which is, BTW, fixed in the current RHEL-3 perl release. I don't have access to perl 5.6 for testing, so 5.8 behaviour may have changed - but in 'man perlform' the RHEL-3 perl-5.8.0, it clearly states: Picture fields that begin with ^ rather than @ are treated specially. With a # field, the field is blanked out if the value is undefined. For other field types, the caret enables a kind of fill mode. Instead of an arbitrary expression, the value supplied must be a scalar vari- able name that contains a text string. Perl puts as much text as it can into the field, and then chops off the front of the string so that the next time the variable is referenced, more of the text can be printed. (Yes, this means that the variable itself is altered during execution of the write() call, and is not returned.) So these two programs behave exactly the same under perl-5.8.0 on RHEL-3, and under perl-5.9.3 (bleadperl) on FC-5 : --- t1.pl: #!/usr/bin/perl $line='12345678'; format STDOUT = ^<<<~~ $line . print "Length before:",length($line),"\n"; write STDOUT; print "Length after:", length($line),"\n"; --- $ ./t1.pl Length before:8 1234 5678 Length after:0 --- t2.pl: #!/usr/bin/perl $line='12345678'; format STDOUT = @<<< $line . print "Length before:",length($line),"\n"; write STDOUT; print "Length after:", length($line),"\n"; $ ./t2.pl Length before:8 1234 Length after:8 Hence I think this is 'NOTABUG' - if you disagree, please re-open citing perl documentation to the contrary. |