473,397 Members | 2,028 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,397 software developers and data experts.

Embed Perl or execute perl script

Hi

I'm currently into converting a perl linux app into a .Net windows service.
The application monitors our syslog log files to capture i.p adress changes
on some of our routers having dynamic i.p. In the syslog logfile i capture
the new IP adress of the router. I then need to telnet to that i.p adress
and fetch the hostname. A list of these routers will be presented on a
webpage.

I've created the application in vb.net and most parts of it is working fine
except for the telnet module. I've created a TCPClient class that takes care
of this. However with my limited .Net experience this is gonna take some
time to implement the Telnet protocol to handle all sorts of stuff :)

However time is limited and i need to get this app up and running. I have a
perlscript doing this for me returning the routerconfig to stdout (the dos
window). I've tried to do a:

Shell(Me.FileToExecute, AppWinStyle.Hide, True, 3000) where Me.FiletoExecute
= C:\Perl\bin\Perl.exe C:\files\syslog\telnet.pl >
C:\files\syslog\SmallOffice93Config.txt

however the shell doesn't like piping to a file and outputs this to the
command window. Is there a way i can fetch the data from the command window,
or a way to pipe the data to a file ? Or is it possible to embed a
perlscript directly into .net ?

I use the Perl ppm module Net-Telnet-Cisco to send my telnet command.

Help is appreciated

Best Regards
Kai Thorsrud
Nov 20 '05 #1
2 6991
In article <#T**************@TK2MSFTNGP11.phx.gbl>, Kai Thorsrud wrote:
Hi

I'm currently into converting a perl linux app into a .Net windows service.
The application monitors our syslog log files to capture i.p adress changes
on some of our routers having dynamic i.p. In the syslog logfile i capture
the new IP adress of the router. I then need to telnet to that i.p adress
and fetch the hostname. A list of these routers will be presented on a
webpage.

I've created the application in vb.net and most parts of it is working fine
except for the telnet module. I've created a TCPClient class that takes care
of this. However with my limited .Net experience this is gonna take some
time to implement the Telnet protocol to handle all sorts of stuff :)

However time is limited and i need to get this app up and running. I have a
perlscript doing this for me returning the routerconfig to stdout (the dos
window). I've tried to do a:

Shell(Me.FileToExecute, AppWinStyle.Hide, True, 3000) where Me.FiletoExecute
= C:\Perl\bin\Perl.exe C:\files\syslog\telnet.pl >
C:\files\syslog\SmallOffice93Config.txt

however the shell doesn't like piping to a file and outputs this to the
command window. Is there a way i can fetch the data from the command window,
or a way to pipe the data to a file ? Or is it possible to embed a
perlscript directly into .net ?

I use the Perl ppm module Net-Telnet-Cisco to send my telnet command.

Help is appreciated

Best Regards
Kai Thorsrud


You might want to try calling the EzPerl API if your using ActiveState
Perl...

I played with this a bit a long time ago with VB5/6, so I don't remember
all of the details. But, it maybe worth a try. Also, you could buy a
telnet component...

--
Tom Shelton
MVP [Visual Basic]
Nov 20 '05 #2
In article <#T**************@TK2MSFTNGP11.phx.gbl>, Kai Thorsrud wrote:
Hi

I'm currently into converting a perl linux app into a .Net windows service.
The application monitors our syslog log files to capture i.p adress changes
on some of our routers having dynamic i.p. In the syslog logfile i capture
the new IP adress of the router. I then need to telnet to that i.p adress
and fetch the hostname. A list of these routers will be presented on a
webpage.

I've created the application in vb.net and most parts of it is working fine
except for the telnet module. I've created a TCPClient class that takes care
of this. However with my limited .Net experience this is gonna take some
time to implement the Telnet protocol to handle all sorts of stuff :)

However time is limited and i need to get this app up and running. I have a
perlscript doing this for me returning the routerconfig to stdout (the dos
window). I've tried to do a:

Shell(Me.FileToExecute, AppWinStyle.Hide, True, 3000) where Me.FiletoExecute
= C:\Perl\bin\Perl.exe C:\files\syslog\telnet.pl >
C:\files\syslog\SmallOffice93Config.txt

however the shell doesn't like piping to a file and outputs this to the
command window. Is there a way i can fetch the data from the command window,
or a way to pipe the data to a file ? Or is it possible to embed a
perlscript directly into .net ?

I use the Perl ppm module Net-Telnet-Cisco to send my telnet command.

Help is appreciated

Best Regards
Kai Thorsrud


Oh, yeah... I thought I better mention - ActiveState creates a .NET
version of Perl. Visual Perl. That would let you convert most of your
Perl code directly to .NET :)

--
Tom Shelton
MVP [Visual Basic]
Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Keith | last post by:
All: What is the difference between Perl (CGI) and PHP (Apache module)? I thought both used servers to direct the user to the appropiate Perl or PHP program in order to execute the program to...
3
by: dpackwood | last post by:
Hello, I have two different scripts that do pretty much the same thing. The main perl script is on Windows. It runs and in the middle of it, it then calls out another perl script that then...
1
by: sm00thcrimnl13 | last post by:
if i have windows 2000 and know how to write perl scripts, how to i actuvate the script through perl?
3
by: PzYon | last post by:
Hey 2gether! I'm trying to execute a PERL script on the web server when the user presses a button in an ASP.NET Web Application using Visual Basic. The most obvious solution for me seemed to be...
8
by: Wonderinguy | last post by:
Hi everybody , I have been trying to execute a simple DB2 stored Procedure from perl. But it doesn't work. Could anybody please help me find out why this is happening : here is my perl script...
1
by: Nathan | last post by:
This may be a basic task to some of you perl guru's, but I have a problem getting a perl script i've written, when executed by httpd, to send out an e-mail. Basically, i have a few variables...
4
by: billb | last post by:
I installed a perl extension for PHP to use some perl inside my php primarily because I have perl working with oracle and not php and oracle. So I want to use my old perl scripts, and use the...
82
by: happyse27 | last post by:
Hi All, I modified the user registration script, but not sure how to make it check for each variable in terms of preventing junk registration and invalid characters? Two codes below : a)...
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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.