in reply to Re: Perl Telnet weirdness
in thread Perl Telnet weirdness

I modified my code as such:

my @lines;
my $command;
$command = "tail -$num $logfile";
@lines = ($t1->cmd('$command'));
print "@lines";

The tail command does not seem to be executed. Nothing is printed to the screen. Any advice?

Replies are listed 'Best First'.
Re3: Perl Telnet weirdness
by insensate (Hermit) on Nov 11, 2002 at 17:24 UTC
    Remember that single quotes supress variable interpolation...so '$command' will not be interpreted as it's contents...try
    $t1->cmd($command);