Re: Bug in formline
On Sun, 08 Dec 1996 19:06:42 +0100, Gary Howland wrote:
>Is this a bug?
>
>The following program:
>
> #!/usr/local/bin/perl -w
>
> sub format_text
> {
> my $format = shift;
> $^A = "";
> formline($format, @_);
> return $^A;
> }
>
> my $picture = '
> A: @<<<
> B: @|||
> C: @>>>
> ';
>
> print format_text($picture, 1, 2, 3);
>
>gives this output:
>
> A: 1
> B: 2
> C: 3
>
>when I would have expected:
>
> A: 1
> B: 2
> C: 3
>
>it seems that the carriage returns are incorrectly placed.
>
>
>If I change $picture to this:
>
> my $picture = '
> A: @<<< a
> B: @||| b
> C: @>>> c
> ';
>
>I get a segmentation violation from perl.
The latter should work flawlessly in 5.003_05 and later ("my" variables
as formline picture arguments were broken before).
The attached patch (against 5.00308, but should apply clean over 3_11
as well), should cure the first problem.
- Sarathy.
gsar@engin.umich.edu
p5p-msgid: <
199612081958.OAA26025@aatma.engin.umich.edu>