I believe that perl thinks that $SUBJECT is a variable and is trying to store it into @vacation_str, but failing to do so. I am looking for a way to escape the $ before it is stored into @vacation_str so it won't see $SUBJECT as a variable. I also had my eye on the Net::Telnet functions 'get' and 'getlines' to try take the input a different way. However, I don't know if this is a dead end. I am greatful for any advice that anyone has on this issue. Thanks for reading this. Joe#!/usr/bin/perl my $username="user1"; my $password="password"; my $host="localhost"; my $CAT = "/usr/bin/cat"; my $LAST = "/usr/bin/last"; &start_login; print "@vacation_str\n"; sub start_login { my $telnet = new Net::Telnet; telnet_login($username,$password,$host,\$telnet); @vacation_str=$telnet->cmd("$CAT /home/$username/.vacation.msg"); telnet_close(\$telnet); } sub telnet_login { use Net::Telnet; my ($username, $password, $host, $telnet) = @_; my $error_msg = "Incorrect username or password, please try again" +; my $error_type = "ERROR"; $$telnet = new Net::Telnet ('Timeout'=>'7', 'Errmode'=> sub { &report_error($error +_type,$error_msg); }, 'Prompt'=> '/.*([\$#\%>~]|\\\[\\e\[0m\ +\\] \[0m)\s?/' ); $$telnet->open(Host=>$host); $$telnet->login($username,$password); } sub telnet_close { my $telnet=shift; $$telnet->close; }
In reply to Can't get $ from Net::Telnet by JoeJaz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |