So I have two variable one is a string and the other is a list . How do I pass the string and the list to another Perl file?
This is my python code
import subprocess
import os
method = "add"
server_info = [1,2,3,4,5,6,7,8,9]
ping = subprocess.Popen(["perl","file1.pl"]+method+server_info)
output, errors = proc.communicate()
And my perl file i.e file1.pl
contains this code
#!/usr/bin/perl
my ($method, @server_info) = @ARGV;
print $method;
for(i=0;i<len(@server_info);i++)
{
print @server_info[i]
}
And I'm facing this error
TypeError: can only concatenate list (not "str") to list