Hi,

Not sure this list is the right place for this problem.
On unix I have been pestered for a while with a diag I can't figure out.Here is a test 
case:

### Main script "tdiag.pl" reads:

#!/usr/local/bin/perl -w
# test diag I/O
use strict;
$\ = "\n"; # print with \n
print ".. perl version: $]";

use plib qw(ofil);
use qlib qw(msep glin);

$ARGV[0] = 'truc'; # file truc contains some text
local (*IN); # filehandle
plib::ofil(*IN) || exit; # open file
qlib::msep(*IN); # print 1st line

for (1..5) {local $\;
    print "$_: ", qlib::glin(*IN); # print more lines
}
print '- - -';
1;
__END__

### file plib.pm reads:

package plib;
use strict;

sub ofil {print ".. lib plib";
    open $_[0],$ARGV[0] or die ".. $ARGV[0] not open (p.ofil)";
}
1;
__END__

### file qlib.pm reads: (line numbers for ref only, not in file)

 1. package qlib; # 10
 2. use strict;
 3. my ($box,$hed,$lin);
 4. 
 5. sub glin {print "..";
 6.    $box = shift; $_[0] = <$box>;
 7. }
 8. 
 9. sub msep {
10.    my $fil = shift;
11.    my $z = tell $fil;
12.    $_ = <$fil>;
13.    print;
14.    seek $fil, $z, 0;
15.    return 0;
16. }
17. 
18. #-------------------------------------------------
19. sub gore { # bogus, not used, but fires diags
20.       $hed = <$box> || return;
21.       print $hed;
22.       while () {
23.       $_[0] = <$box> || last;
24.       $lin = <$box> || last;
25.       $_[0] = <$box> or last;
26.       $lin = <$box> or last;
27.       ($_[0] = <$box>) || last;
28.       ($lin = <$box>) || last;
29.             last if eof $box;
30.             $lin = <$box>;
31.       }
32. }1;
33. __END__

>tdiag.pl
Value of <HANDLE> construct can be "0"; test with defined() at qlib.pm line 26.
Value of <HANDLE> construct can be "0"; test with defined() at qlib.pm line 28.
. perl version: 5.00404
. lib plib
>From [EMAIL PROTECTED]  Thu Apr  1 21:59:58 2004

.1: From [EMAIL PROTECTED]  Thu Apr  1 21:59:58 2004
.2: Return-Path: <[EMAIL PROTECTED]>
.3: Received: from smtp2.enst.fr (reloaded.enst.fr [137.194.2.14])
.4:    by email.enst.fr (8.9.3/8.9.3) with ESMTP id VAA14413;
.5:    Thu, 1 Apr 2004 21:59:58 +0200 (CEST)
- - -

> tdiag.pl
Value of <HANDLE> construct can be "0"; test with defined() at qlib.pm line 25.
Value of <HANDLE> construct can be "0"; test with defined() at qlib.pm line 26.
Value of <HANDLE> construct can be "0"; test with defined() at qlib.pm line 27.
Value of <HANDLE> construct can be "0"; test with defined() at qlib.pm line 28.
. perl version: 5.006001
. lib plib
>From [EMAIL PROTECTED]  Thu Apr  1 21:59:58 2004

.1: From [EMAIL PROTECTED]  Thu Apr  1 21:59:58 2004
.2: Return-Path: <[EMAIL PROTECTED]>
.3: Received: from smtp2.enst.fr (reloaded.enst.fr [137.194.2.14])
.4:    by email.enst.fr (8.9.3/8.9.3) with ESMTP id VAA14413;
.5:    Thu, 1 Apr 2004 21:59:58 +0200 (CEST)
- - -

The problem is with sub "gore" in qlib.It is not used, but somehow sends diags. Why ? 
Could it not be ignored ?

Lines 23 24 30 make no trouble.
Line 25 squeaks with perl 5.006001, not with 5.00404.
Line 26, with same syntax as line 25, squeaks with 5.00404.
Lines 25 27 squeak with perl 5.006001, not with 5.00404.
Lines 26 28 squeak with both perl versions

I'm puzzled. Why is gore interfering at all, and what's wrong with the squeaking 
statements ?

Somehow execution proceeds correctly, but the diags are a hindrance.

Thanks for explanations.

Reply via email to