<div>Below is some sample code I came across in its entirety. I'm looking for some clarification.</div><div><br></div><div>There is a comment on the first statement after the eval, "race condition protection". What exactly is the race condition its referring to?</div>

<div><br></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>#------------------------</div></div><div><br></div><div>eval { </div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">

<div>local $SIG{ALRM} = sub { die 'Timed Out'; }; </div><div>alarm 3; </div><div>my $sock = IO::Socket::INET->new( </div></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">

<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div>PeerAddr => inet_ntoa( gethostbyname($host) ), </div></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">

<div>PeerPort => 'whois', </div></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div>Proto => 'tcp', </div></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">

<div>## Timeout => , </div></blockquote></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div>); </div><div><br></div><div>$sock->autoflush; </div><div>

print $sock "$qry\015\012"; </div><div>undef $/; $data = <$sock>; $/ = "\n"; </div><div>alarm 0; </div></blockquote><div>}; </div><div><br></div><div>alarm 0; # race condition protection  <<<*********</div>

<div><br></div><div>return "Error: Timeout." if ( $@ && $@ =~ /Timed Out/ ); </div><div>return "Error: Eval corrupted: $@" if $@;</div><div><br></div><div>#------------------------</div><div><br>

</div>Thanks,<br>Sean<br><br><br>