LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-15-2006, 03:01 AM   #1
alix123
Member
 
Registered: Nov 2004
Posts: 63

Rep: Reputation: 15
Executing Perl under Dos /Creating an executable for DOS


I want to execute the following program under DOS.

I converted this "test.pl" into "test.exe" using perl2exe. however at the time of executing it under DOS it gave an error this program cannot be execute under DOS.

Is there any way i cann convert this program to a 16bit executable

#!/usr/bin/perl
$found = 0 ;
$last_octet = "" ;
$text = "192.168.251." ;
system("ipconfig >ip.txt") ;
open (IP ,"ip.txt") or die "Ip address could not be created" ;
foreach $line (<IP>) {
chomp($line);
$_ = $line ;

if($found != 1) {
if(/192.168/){

(undef ,$last_octet) = split($text,$line) ;
# print $last_octet ;
$found =1 ;
}
}
}
close IP ;
unlink ("ip.txt") ;

print $last_octet;
 
Old 02-15-2006, 04:07 AM   #2
Harmaa Kettu
Member
 
Registered: Apr 2005
Location: Finland
Posts: 196

Rep: Reputation: 30
Isn't ipconfig a windows program as well? IIRC DOS does not support TCP/IP at all.

In case the above is wrong, there seems to be a DOS port of perl, see http://perldoc.perl.org/perldos.html. Rewriting your program in C is also an option, and probably easier than getting perl to work.
 
  


Reply



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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Dos Emulator without Dos dtheorem Linux - Software 1 10-14-2003 01:18 PM
Dos Emulator without Dos dtheorem Linux - Software 1 10-14-2003 12:52 PM
How to compile a executable dos file by g++? Xiangbuilder Programming 7 09-23-2003 08:56 AM
Getting rid of DOS JC404 Linux - Newbie 2 07-22-2003 08:44 AM
Dos Eits0 General 2 06-06-2002 01:10 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration