in reply to Perl Telnet weirdness

That's because $$ is the special variable representing the program's pid...try putting the command in single quotes instead...that will supress variable interpolation.

Replies are listed 'Best First'.
Re: Re: Perl Telnet weirdness
by cosmicsoup (Beadle) on Nov 11, 2002 at 17:19 UTC

    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?

      Remember that single quotes supress variable interpolation...so '$command' will not be interpreted as it's contents...try
      $t1->cmd($command);