Some minor thought. %ENV is a global variable, thus everyone using it will be affected by changing it. Consider deciding whether you'd like to set the environment variable for the whole script, or just for your call to iptraf.
If it should be effective for your whole script set it at the beginning of the script, or some other well exposed place. If for the call to iptraf is sufficient consider localizing the change, like so:
{ local %ENV = %ENV; $ENV{TERM} = 'vt220'; # call iptraf, e.g. `/usr/sbin/iptraf -s eth0 -B -L some.log`; }
This will limit the changes to %ENV to the enclosing block, thus the environment will be restored once the block is left. See Temporary Values via local()
It might be worth remembering this for all global variables.
In reply to Re: Problem running IPTraf from Perl
by rblasch
in thread Problem running IPTraf from Perl
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |