while (1)是什么意思?

while (1)是什么意思?

while (1)是什么意思?
下面一段程序是linux服务器上的一段脚本,谁能告诉我while (1)是什么意思?

#!/usr/bin/perl
use Time::Local;

$log_file = '/usr/local/3b2work/3b2/wts_sent.log'; # 定义$log_file标量变量
$days_as_seconds = 604800; # 7 days

while (1)
{
$now = time;
$write_data = 0;
@data = ();

open(FDATA, "cat /usr/local/WTS/transfer.log |") || die("Unable to open log file: $!\n");
while ( defined(($input = <FDATA>)) )
{
chomp($input);
if (!$write_data)
{
if ( $input =~ /^\*\*\*\sTransfer\sStarts\sat\s+(\d+)\:(\d+)\:(\d+)\s+(\d+)\/(\d+)\/(\d+)/i )
{
$time = timelocal($3,$2,$1,$4,($5 - 1),$6);
{
if ($time + $days_as_seconds > $now)
{
$write_data = 1;
push @data, $input;
}
}
}
}
else
{
unshift @data, $input;
}
}
close(FDATA);

open(DATA, ">$log_file") or die("Unable to open log file $log_file for output: $! ||");

foreach $data (@data)
{
chomp($data);
if ($data =~ /^\*\*\*\sTransfer\sEnds/i)
{
$end = $data;
}
elsif ($data =~ /^\*\*\*\sTransfer\sStarts/i)
{
if (@lines)
{
print DATA "$data\n";
foreach $line (@lines)
{
print DATA "$line\n";
}
print DATA "$end\n\n";
@lines = ();
}
}
elsif ($data =~ /^\>\>\>\s.*?\|.*?\|(.*?)\|(.*?)\|.*?\|(.*?)\|(.*)/)
{
@acc_cat = `/home/wts/server/read_control $1 $2`;
chomp $acc_cat[0];
chomp $acc_cat[1];
push @lines, "$4 ($acc_cat[0] - $acc_cat[1]) $3";
}
}
close(DATA);

sleep 600;
}
就是当1为真的时候重复运行大括号里面的东西,1永远是真的,所以不停的执行,很多人都管这种循环叫做死循环。