我有我的数据在一个数组中。我需要将数组值传递给ARSperlars_CreateEntry
中的函数
。该数组是根据接收到的输入动态形成的,因此其长度可能会有所不同。
#!/usr/bin/perl
use strict;
use ARS;
use ARS::Login;
my $server = '125.10.14.1';
my $username = 'RemedyUser';
my $dbsid = $ENV{'ORACLEID'};
my $dbuser = 'admin';
my $schema = 'Form 1';
my $control = remedyars_login( $username )
or die "ERROR: Cannot login to $server \n";
my $dbh = remedydbi_login( $dbsid, $dbuser )
or die( "Cannot connect to $dbsid: $DBI::errstr\n" );
my @arr = ( 1, "New", 2, "Test", 3, "Hi" );
my $created_ticket = ars_CreateEntry( $control, $schema, join( ",", @arr ) )
or die "ERROR: Cannot create host ticket: $ars_errstr\n";
ars_Logoff( $control );
当我运行脚本时出现此错误
错误:无法创建主机票证:[错误] 参数数量无效 (ARERR #80000)