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