我正在开发 perl 应用程序,我想在我的 javascript 警报中打印 perl 数组,但它不起作用,这是我的代码
sub leaveInfo{
my ( $title_id ) = @_;
$sql = "SELECT tab_timeslot.`location` , tab_timeslot.`date` , tab_timeslot.`time` , tab_timeslot.`end_time`
FROM tab_appointment
INNER JOIN tab_timeslot ON tab_appointment.timeslot_id = tab_timeslot.timeslot_id
WHERE tab_appointment.lecture_id ='" . $title_id ." '";
$query = &statement_database($sql);
my @co;
my @arro;
my $num = 0;
while(my(@co)=$query->fetchrow_array){
push (@arro,$co[$num]);
$num++;
}
print @arro;
}
print '<script type="text/javascript">' . "\n" .
' Check = confirm("Do you really want to leave this lecture?'.leaveInfo(1215).'");' . "\n" .
' if (Check == false) history.back();' . "\n" .
' else location.href="index.pl?value=my_events&to_do=leave_lecture_exec&user_id=' . $cgi->param('user_id') . '&title_id=' . $cgi->param('title_id') . '"' . "\n" .
'</script>' . "\n";
}
警报仅显示存储在数组中的对象数量而不是数组本身的值,任何帮助都会有所帮助