Commit | Line | Data |
2304df62 |
1 | Replied: Wed, 02 Mar 94 09:29:46 -0800 |
2 | Replied: brad_figg@rainbow.mentorg.com ("Brad Figg") |
3 | Return-Path: brad_figg@rainbow.mentorg.com |
4 | Return-Path: <brad_figg@rainbow.mentorg.com> |
5 | Received: from mgc.mentorg.com by netlabs.com (4.1/SMI-4.1) |
6 | id AA15524; Wed, 2 Mar 94 09:17:50 PST |
7 | Received: 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 |
9 | Received: 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 |
11 | Received: 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 |
13 | Received: from cynic.MENTORG.COM by em-wv02.MENTORG.COM (4.1/CF3.4) |
14 | id AA23300; Wed, 2 Mar 94 09:16:50 PST |
15 | Received: by cynic.MENTORG.COM (4.1/CF3.4) |
16 | id AA24503; Wed, 2 Mar 94 09:16:50 PST |
17 | From: brad_figg@rainbow.mentorg.com ("Brad Figg") |
18 | Message-Id: <9403020916.ZM24501@cynic> |
19 | Date: Wed, 2 Mar 1994 09:16:50 -0800 |
20 | X-Mailer: Z-Mail (3.0.0 15dec93) |
21 | To: lwall@netlabs.com |
22 | Subject: Perl5 Alpha 6 bug (subs & formats) |
23 | Content-Type: text/plain; charset=us-ascii |
24 | Mime-Version: 1.0 |
25 | |
26 | |
27 | The following works just fine as is with Perl 4 but doesn't work with |
28 | Perl5 Alpha 6 unless the format lines are moved outside the sub block. |
29 | |
30 | |
31 | Brad |
32 | |
33 | p.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 | |
45 | package Error; |
46 | |
47 | push( @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 | |
80 | sub Emsg |
81 | { |
82 | local( $String, @Args ) = @_; |
83 | local( $Err ); |
84 | |
85 | format EFIRSTLINE = |
86 | *** Error: ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
87 | $_ |
88 | ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~~ |
89 | $_ |
90 | . |
91 | |
92 | format 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 | |