in reply to Re: Re[3]: Modifying STDOUT and keeping control
in thread Modifying STDOUT and keeping control

Well, the relevant code is:

system('telnet' , '192.168.1.1');

As `perldoc -f system` tells you, system() forks off a child, waits for it to exit and then returns to your program. `perldoc perlop` tells us that qx// does the same, but catches the stdout of the command and returns it (exit status should be in $? anyways). So I can't see why you cannot use qx//...

my $var = `telnet 192.168.1.1`; $var =~ s/192.168.1.1//; print $var;

update: oops, code tag typo, thanks Aristotle.

--
http://fruiture.de