To interpolate a variable within a string, enclose it in " " quotes. If you want to interpret the string literally, you can use ' ' quotes. See perldata for more information.
To concatenate strings, use the . operator as discussed in perlop.
Your code features several lines of the form:
$telnet->print('helo '$v_server);
Note that you attempt to pass a literal string ('helo') and concatenate it (with $v_server), but you didn't use the concatenation operator, hence the syntax error.
I believe you were looking for either of the following:
$telnet->print('helo '.$v_server); # Concatenation method
$telnet->print("helo $v_server"); # Interpolation method
Lastly, your suspicions about $telnet->print('helo $v_server'); were correct -- it does not interpolate, and consequently prints the literal string: helo $v_server. |