Odud has asked for the wisdom of the Perl Monks concerning the following question:
Which works fine on NT 4 but reports warnings under W98.#!/usr/bin/perl use warnings; while(1) { open(IPCONFIG,"ipconfig|") or die "can't read from pipe $^E"; while(<IPCONFIG>) { if (/IP Address/) { print $_; } } sleep(10); }
Both are running ActiveState build 613. If, instead of reading from a pipe I execute the command in backticks and put the result into a scalar the warning does not occur. Can anyone explain what is happening, and if there is anything I can do to prevent the warning.C:\Pete>perl connected.pl IP Address. . . . . . . . . : 0.0.0.0 Warning: unable to close filehandle IPCONFIG properly. IP Address. . . . . . . . . : 0.0.0.0 Warning: unable to close filehandle IPCONFIG properly. IP Address. . . . . . . . . : 195.44.21.11
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Unable to close filehandle properly
by Odud (Pilgrim) on Jun 14, 2000 at 00:12 UTC | |
|
(jcwren) Re: Unable to close filehandle properly
by jcwren (Prior) on Jun 13, 2000 at 23:30 UTC | |
by Odud (Pilgrim) on Jun 13, 2000 at 23:41 UTC |