Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old August 8th, 2000, 09:19 PM
Vagabond Vagabond is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Posts: 3 Vagabond User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I am very, very, very new to CGI / Pearl, so I apologize in advance for my vast ignorance on this subject. My task is to find a way interface a CGI program with a DOS program sitting on a UNIX server. Here are the specifics:

From a web browser, a user will start up a DOS program sitting on a UNIX server. The DOS program will send output to the user's web browser that will be displayed as HTML. The user will then enter some input into the web browser, which will then be sent back to the DOS program for processing. Next the DOS program will send output, based on the user's last input, back to the user's web browser. And so on.

Is this possible? If so, can someone help me understand how to do this? Code examples would be greatly appreciated since I don't really understand much about Pearl yet. Again, I'd be tremendously thankful if someone could help solve this problem, or perhaps point me to a site where I might be able to get some help.


------------------
All the world's a stage, and all the men and women merely players...

Reply With Quote
  #2  
Old August 8th, 2000, 09:35 PM
JonLed JonLed is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2000
Location: Indiana
Posts: 614 JonLed User rank is Corporal (100 - 500 Reputation Level)JonLed User rank is Corporal (100 - 500 Reputation Level)JonLed User rank is Corporal (100 - 500 Reputation Level)JonLed User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 h 49 m 49 sec
Reputation Power: 9
You can't run a DOS program on a Unix OS, that's why it's called a DOS program.

I suggest you find a way to do whatever the "DOS" program does, in perl. (and yes, it's Perl, not Pearl ).

Reply With Quote
  #3  
Old August 9th, 2000, 06:57 AM
Vagabond Vagabond is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Posts: 3 Vagabond User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Sorry about the Pearl/Perl thing URL

Anyway, I thought what you're saying too...I mean, how can these people run a DOS program on a UNIX machine? I'll have to get more details on whether they actually can run this DOS program in UNIX, or whether that's just wishful thinking. Assuming they can, does anyone have any ideas?


------------------
All the world's a stage, and all the men and women merely players...

Reply With Quote
  #4  
Old August 9th, 2000, 12:08 PM
JonLed JonLed is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2000
Location: Indiana
Posts: 614 JonLed User rank is Corporal (100 - 500 Reputation Level)JonLed User rank is Corporal (100 - 500 Reputation Level)JonLed User rank is Corporal (100 - 500 Reputation Level)JonLed User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 h 49 m 49 sec
Reputation Power: 9
Well there isn't a category of programs called "DOS programs". Just programs that are designed and compiled for and under that OS. You can run a .exe file on a Unix server, if it's deigned for a Unix server.

Reply With Quote
  #5  
Old August 9th, 2000, 08:54 PM
dwarf dwarf is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 300 dwarf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Just it wouldn't be an .exe file...ELF binary maybe???

Reply With Quote
  #6  
Old August 10th, 2000, 07:24 AM
Vagabond Vagabond is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Posts: 3 Vagabond User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Okay, if let's assume it's just some sort of executable, maybe not an EXE, but whatever type of program is native to Unix..or let's assume that the DOS program is running in a DOS emulator on Unix. Whatever, that's not the most urgent thing for me at this point.

My questions deal with how I would:

1. Start up the program.
2. Receive its output.
3. Format its output as HTML and send to the user's browser.
4. Send new input to it.
5. Receive its output.
6. Format its output as HTML and send to the user's browser.
7. Etc, etc, etc...

Can anyone provide some simple code examples for me on how this is accomplished in Perl? Thanks in advance.




------------------
All the world's a stage, and all the men and women merely players...

Reply With Quote
  #7  
Old August 10th, 2000, 11:23 AM
dwarf dwarf is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 300 dwarf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Well, one way would be to mimic what the program is doing in Perl. If you can do that, I would suggest it.

But, it is most likely that you cannot do that, so off we go into a different approach. What you are trying to do, by the looks of it, is called "opening bidirectional pipes". Perl alone cannot do this. You will need to use one of the modules that comes standard with Perl and is called IPC::Open2. It is not that hard to use, but you should read the docs first. Try

perldoc IPC:Open2

and it should give you its man page where you can see how to use it. HTH.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > CGI/Pearl Interfacing w/ DOS Program Question


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway