LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 12-03-2005, 03:42 PM   #1
Xyem
Member
 
Registered: Apr 2005
Distribution: Fedora Core 4
Posts: 100

Rep: Reputation: 15
Compile Perl into executable


In Windows this would be about converting a Perl script into an .exe. I want to do something similiar but into a Linux executable (which doesn't seem to have an extension). How can I do this or is there a particular program I need to use?
 
Old 12-03-2005, 04:37 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,415

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
have a look at the B perl module.
 
Old 12-04-2005, 10:03 AM   #3
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,791
Blog Entries: 1

Rep: Reputation: 414Reputation: 414Reputation: 414Reputation: 414Reputation: 414
While I admit to being functionally illiterate in perl, wouldn't simply making the script executable with chmod essentially do the same thing? I know it wouldn't be a binary, but it would be executable.
 
Old 12-04-2005, 11:01 AM   #4
Xyem
Member
 
Registered: Apr 2005
Distribution: Fedora Core 4
Posts: 100

Original Poster
Rep: Reputation: 15
I want people who do not have Perl to be able to run it..
 
Old 12-04-2005, 05:04 PM   #5
spooon
Senior Member
 
Registered: Aug 2005
Posts: 1,755

Rep: Reputation: 48
This is very hard or impossible. Because Perl is an interpreted language with stuff like "eval", you would essentially have to include Perl along with your script. You would be better off writing your program in a compiled language like C++ or something. Also, there are few if any Linux users who don't have Perl.
 
Old 12-04-2005, 05:41 PM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,415

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
like i already said, use the B module. it is not hard nor impossible to compile perl.
 
Old 12-05-2005, 03:38 AM   #7
Xyem
Member
 
Registered: Apr 2005
Distribution: Fedora Core 4
Posts: 100

Original Poster
Rep: Reputation: 15
Firstly I don't know any other language. Secondly I don't want to start learning a new language or I'll get confused. Thirdly you can easily make Perl scripts into Win32 executables so you can compile Perl.

Could you give me a link to this 'B' module? I can't seem to find anything about it (though it was only a quick look as I had work)
 
Old 12-05-2005, 03:44 AM   #8
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,415

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
it's part of the core perl system, check perldoc
 
Old 12-05-2005, 06:00 PM   #9
kylomonkey
LQ Newbie
 
Registered: Dec 2005
Distribution: Gentoo
Posts: 1

Rep: Reputation: 0
Look into the command perlcc it comes with the standard perl distrubution.
It Should do the job for you
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
kernel 2.6.3 compile ends in grub error 13: unsupported executable format(?) browny_amiga Linux - General 4 03-06-2004 03:33 PM
Perl to executable ganninu Programming 4 12-18-2003 01:23 PM
Compile errors "can't create executable"! bruno buys Conectiva 5 12-11-2003 12:21 PM
How to compile a executable dos file by g++? Xiangbuilder Programming 7 09-23-2003 09:56 AM
Converting perl files to executable mac files mrozkan Programming 0 04-16-2002 10:56 AM


All times are GMT -5. The time now is 05:10 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration