Hi all,

I have a code part like the following.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
open MYPROFILE, "cat mytxtfile |";
if ( $! != 0 ) {
  print "h1 -> $!\n";
}
while (<MYPROFILE>) {
next if /^(tcp|udp)/;
print;
}
close MYPROFILE or die "bad: $! $?";

if ( $! != 0 ) {
  pr_my_error_routine “close error in MYPROFILE with $!\n”;
}
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

As a beginner user, I try to use my error routine instead of die method
after a simple check 
of last command exit code. 

Here if I use a text file
     open MYPROFILE, "mytxtfile " 
instead of a pipe it works. My problem is non-zero value after close of a
pipe. die works (I mean it doesn’t die as expected), but I can’t use if ( $!
!= 0 )  … instead of die.

TIA,

OKI



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to