如何将打印输出发送到 perl/tk 列表框,可以有无限的打印行。我知道如何创建列表框,但现在不知道如何调用列表框并打印到它。这是逐行生成打印的代码。
[code]
#!/usr/bin/perl -w
use strict;
#Read input file a line at a time
$mydelimiter=",";
open (INPUT1,"$INFILE1") or
die " cannot open $INFILE1";
while (<INPUT1>) {
@INFILE = ($_);
chomp($_);
@FAILS = split (/,/,);
@SERVER = splice (@FAILS,0,1);
@TYPE = splice (@FAILS,0,1);
@REASON = splice (@FAILS,0,1);
@STATUS = splice (@FAILS,0,1);
@TICKET = splice (@FAILS,0,1);
@RESOLUTION = splice (@FAILS,0,1);
foreach $server1 (@SERVER) {
$servers = $server1;
$servers =~ tr/[a-z]/[A-Z]/;
}
foreach $type1 (@TYPE) {
$types = $type1;
$types =~ tr/[a-z]/[A-Z]/;
}
if ( "$types" eq "F") {
$types="FAILED";
}
else {
if ("$types" eq "S") {
$types="FILES";
@TICKET="TICKET";
}}
$value= &read_location;
if ("$value" ne "0"){
print "@SERVER \n";
}
[code]