A question in Perl

来源: 2006-04-30 19:50:11 [旧帖] [给我悄悄话] 本文已被阅读:

Did anyone knows why the following happens?

Please see the codes first:

---------------------------------------------------------------------------
#! user/bin/perl -w

use Win32;
$dbDestin="C:\\temp\\test.txt";
$dbdir="C:\\temp";

$name="Users";

$response=Win32::MsgBox("Are you sure to overwrite?",36);

if ($response==6) {
system("cacls $dbDestin /e /c /g $name:c") and die "$!";
system("cacls $dbdir /e /c /g $name:c") and die "$!";
}
------------------------------------------------------------------------------

After the window prompts, if you select "yes" by mouse, the program will halt on executing the first system call. But if you use "Ener" key to select "Yes" (keyboard), the program will go through. Does anyone know why this happens?

Please help me out! Thanks ahead!