AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

How to pass multiple parameters to subroutine in RS in perl
 
 

I have written a reply subroutine with Perl. It is ok when it takes input as a single keyword but I need multiple keywords to be taken as input how do I pass that as a parameter. My RS code in Perl has

+ what is *
- <call>getanswer <star></call>

+ when is *
- <call>getanswer <star></call>

> object getanswer perl
  my ($self, $args) = @_;
use MongoDB;
sub answer_get {
do something…....
}
my $get_answer = answer_get(“xxxx”, “xxxx”, “$args”);

if ( defined($get_answer) ){
return $get_answer;
}
else {
return "No";
}

< object
Here when question is what <star> tag will pass on keyword. With <star> keyword I need another keyword as an input to getanswer subroutine. Suppose I ask what is AI. I need to pass AI (which is there in <star> tag) and also need context of question so need to pass another keyword what.
How do I do it here. When I try to elaborate @_ it is giving error.

my ($self, $args, $args1) = @_;

Use of uninitialized value $args1

 

 
  login or register to react