Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text comparing 2

Status
Not open for further replies.

DaneshD

Programmer
Dec 10, 2004
19
0
0
SE
Hi all,

I am just completely new with perl. At first I have downloaded perl-5.8.5 but I can not use it yet, but thats not the problem. I know that perl would be great for text processing. Now, I am involved in a project and I have already written a smart routine which compares two texts and examine how much do the differ from each other. It can be pretty complex as it is, but it could be better anytime. However, I have implemented and my idea was almost good, but I am thinking that perl would be great for such tasks and even better than VC or Win32 Assembly, am I right ? If yes, is it possible to compile a perl script and run it as a stand-alone exe file ? If again yes, can anybody guide me how to compile a simple per script ?

Thanks,

Danesh Daroui

 
Though I'm sure this has come up before, my personal favorite way to make executables from perl is with PAR's pp utility, though others are sure to mention at least perl2exe.

Yes, perl is a great text processing tool. The mantra goes "You can write faster code in C, but you can write code faster in Perl." and pretty much holds true. At worst, it's a great prototyping language. Once you figure out what you need to do and how you're going to do it, you can optimize your heart away, or even port it to another language. The best bet may be to simply write the tighter parts of the code in C/asm and link them with XS into the rest of the perl application.

________________________________________
Andrew

I work for a gift card company!
 
I've searched and can't find a repository for pp for windows.
Any clues ?
TIA's
- BG
 
Thanks. Well, I am pretty new with perl so sorry if my questions are so elementary or perhaps foolish some times. ;) I downloaded pp, but I think it is under Linux or other unix based systems, right ? But, I tried Perl2exe and seems to work fine. So, you mean it is completely enough to generate executeable perl codes ? I have visited Activeperl web site and there are many other tools for perl programmers such as Visual Perl or Perl Editor which make life easier for perl gurus, but they are not free. Should I download anything else to be able compile perl scripts ? I am asking because I have already downloaded Perl-5.8.5 in zip file and I could not use it and I am wodering what is it !!! Because Perl2exe may generate executeable perl files and perl CGI scripts may execute by perl module at a web server such as Apache which should be loaded by web server. So what this Perl zip fils is ? Well, I have bad memory of using Perl because I tried before and I wasn't success. ;) By the way, I am using Perl on a Windows XP system, but I can test it on both Fedore (Redhat) Linux and Mandrake Linux systems too.

Thanks,

Danesh Daroui

 
To install Perl itself on Windows, grab the MSI installer from here.

Once you have ActiveState Perl installed, run "ppm install par" from the command line. This should install PAR and all its associated parts, one of which is pp, the Perl-Packager. You don't have to install pp, it comes with PAR, so if you install the PAR distribution, you have pp. And it works wonderfully in Windows.

From there, you just run "pp -o script.exe script.pl" and it will generate script.exe. It takes a little while to compile it, and it ends up being a large file. When it runs, there's a hefty-startup time, too. This is all because it embeds a Perl interpreter in the exe, and there's not really a way around that. The -d option to pp is designed to let you use a perl58.dll and cuts the file size in half (the other half is in the dll), but I've not had good luck with the version that comes via ppm (worked fine when I compiled the module myself).

________________________________________
Andrew

I work for a gift card company!
 
Thanks Andrew
Thats solved it.
I woz trying to do "ppm install pp". D'oh.
I give you a star.
- BG
 
Thanks Andrew, it was cool. Hope to see ya around again...
This is oyur star...

PS: OOPPPSSSS... bluegroper you got a star form me by mistake :)))) I just clicked on wrong link... lol



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top