1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
Replied: Wed, 02 Mar 94 09:29:46 -0800
Replied: brad_figg@rainbow.mentorg.com ("Brad Figg")
Return-Path: brad_figg@rainbow.mentorg.com
Return-Path: <brad_figg@rainbow.mentorg.com>
Received: from mgc.mentorg.com by netlabs.com (4.1/SMI-4.1)
id AA15524; Wed, 2 Mar 94 09:17:50 PST
Received: from rainbow.mentorg.com by mgc.mentorg.com with SMTP
(16.6/15.5+MGC-TD 2.20) id AA04359; Wed, 2 Mar 94 09:16:55 -0800
Received: from wv.mentorg.com by rainbow.mentorg.com with SMTP
(15.11.1.6/15.5+MGC-TD 2.08) id AA22830; Wed, 2 Mar 94 09:16:53 -0800
Received: from em-wv02.MENTORG.COM by wv.mentorg.com (8.6.4/CF5.11R)
id JAA18865; Wed, 2 Mar 1994 09:16:51 -0800
Received: from cynic.MENTORG.COM by em-wv02.MENTORG.COM (4.1/CF3.4)
id AA23300; Wed, 2 Mar 94 09:16:50 PST
Received: by cynic.MENTORG.COM (4.1/CF3.4)
id AA24503; Wed, 2 Mar 94 09:16:50 PST
From: brad_figg@rainbow.mentorg.com ("Brad Figg")
Message-Id: <9403020916.ZM24501@cynic>
Date: Wed, 2 Mar 1994 09:16:50 -0800
X-Mailer: Z-Mail (3.0.0 15dec93)
To: lwall@netlabs.com
Subject: Perl5 Alpha 6 bug (subs & formats)
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0
The following works just fine as is with Perl 4 but doesn't work with
Perl5 Alpha 6 unless the format lines are moved outside the sub block.
Brad
p.s. I'm not currently at a point where I can make the actual offer
but I'm just asking if you have any interest. I have access to
'Purify' and 'Quantify' from Pure Software. I was thinking of
building Perl5 with these just to see what I'd get. Would you
be interested in the results?
-----------------------Error.pl---------------------------------
######################################################################
## Package Variables
##
package Error;
push( @main'Versions, '$Id: Error.pl,v 1.3 1994/02/13 00:26:00 bradf Exp $' );
$Strings[ ($None = 0) ] =
"Everythings OK";
$Strings[ ($BadFileOpen = 0) ] =
"I was unable to open the file \'%s\' due to:\n$!";
$Strings[ ($NoVersion = 0) ] =
"Unable to read the first four bytes from the file." .
" This probably means it is an empty file.";
######################################################################
##
## Emsg
##
## Print a formatted error message to STDERR.
##
## Args: 2
## 1. An error message that may contain printf formatting strings.
## 2. A list of arguments to be used for the format string
## expansions.
##
## Returns:
##
## if successful: none
## if unsuccessful: none
##
## Calls:
##
## Requires:
##
## Notes:
##
sub Emsg
{
local( $String, @Args ) = @_;
local( $Err );
format EFIRSTLINE =
*** Error: ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$_
^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~~
$_
.
format EBODY =
^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~~
$_
.
$~ = 'EFIRSTLINE';
$Err = sprintf( $String, @Args );
foreach (split( "\n", $Err )) {
if ( $_ eq '' ) { print( "\n" ); }
write;
$~ = 'EBODY';
}
}
[Acked]
|