473,399 Members | 3,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

How to get the output from telnet commands in Perl?

Expand|Select|Wrap|Line Numbers
  1. use Net::telnet
  2. telnet->open($host);
  3. telnet->logint("rrot","rut"
  4. $a=telnet->cmd("ls");
using telnet i am running this command to remote machine its is connecting to remote machine.
but the output of "ls" is not coming in $a.
a is having the status of the ls command it is not having results .a is having 0 or 1.
ouput is not coming in a
Nov 5 '10 #1
1 5597
toolic
70 Expert
Try to capture the cmd output into an array variable instead of a scalar variable:

Expand|Select|Wrap|Line Numbers
  1. my @lines = $telnet->cmd("ls");
This is discussed in the cmd section of the Net::Telnet documentation.
Nov 5 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: nicolas | last post by:
Hello, I hesitated a lot before posting this topic here, but it seems more appropriate than posting it in c.l.perl. I would like to know how to change output encoding when using the perl...
5
by: Greg Martz | last post by:
I'd like to do the following in C# and prefer using tcpclient rather than raw sockets... Connect to a unix box Login run date +%H%M%S retrieve the response. That's it, nothing more. This...
7
by: Rex Winn | last post by:
I've Googled until my eyes hurt looking for a way to issue Telnet commands from C# and cannot find anything but $300 libraries that encapsulate it for you. I don't want to be able to create a...
1
by: johnhangey | last post by:
I know it is probably easy, but I am more of a code tweaker, than a developer, and i want to develop a simple html page that can output data from txt boxes, dropdowns, and a browse button, to simple...
4
by: chandru1985 | last post by:
Hi Guys , Can u help me out in Pel Coding as i'm new to perl . Can any one of them say whether it to print a line in a colored way in the output file using Filehandler .. Codin is :::...
3
shrek123
by: shrek123 | last post by:
How can I pass output of some perl subroutine to a subroutine? I have Subroutine1 and wanna pass the return value of this subroutine as an argument to another subroutine. I tried this; ...
5
by: pbd22 | last post by:
Hi. Anybody know of any good code examples out there on how to take a telnet command and parse it? Thanks!
1
by: afelotreyu | last post by:
Hello, I currently have an application in perl that starts a text based torrent client, once I give the necessary parameters to the torrent.exe it will start printing out the following information...
2
by: HTCGuy | last post by:
Hi, im building an application that has to run a series of simple telnet commands . login wget some links chmod some files exit The only thing Ive found sofar are massive fully function c#...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.