Welcome to Dream.In.Code
Getting Help is Easy!

Join 86,254 Programmers. There are 2,130 online right now! Ask your question and get quick answers from Dream.In.Code experts. Join the #1 programming help community on the internet! Registration is fast and FREE... Join Now!

Chat LIVE With a Expert
Powered by LivePerson.com

Register to Make This Box Go Away!

2 Questions on Perl

 
Reply to this topicStart new topic

2 Questions on Perl

spearfish
post 6 May, 2008 - 04:38 AM
Post #1


Monkey in Training

Group Icon
Joined: 10 Mar, 2008
Posts: 670



Hey all,

I've been finding that a lot, I mean a lot of employers in the web-engineering business want you to know some Perl. So, I figured, why not learn a bit of it?

I do, however, have 2 questions.

1) What can Perl do that PHP can't do? The common opinion is that Perl can do more.... but just what is this more?

2) Compiling to .exe.... what happens if I just print something with the executable? How do I compile to a chinsy, good looking, GUI app?

Thanks,
-Spear
User is offlineProfile CardPM
Go to the top of the page
+Quote Post


girasquid
post 6 May, 2008 - 08:01 AM
Post #2


Barbarbar

Group Icon
Joined: 3 Oct, 2006
Posts: 953

Perl is a lot like PHP - except that it's not limited to the web. Running Perl scripts on the web is actually achieved by using a module - while it may be something Perl can do, (I don't believe) it's what Perl was originally intended for.

If you want to create a GUI app in Perl, you'll probably want to look into a module like Tk.

User is offlineProfile CardPM
Go to the top of the page
+Quote Post

spearfish
post 6 May, 2008 - 09:06 AM
Post #3


Monkey in Training

Group Icon
Joined: 10 Mar, 2008
Posts: 670

Thanks =D
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Petebardo
post 6 May, 2008 - 11:10 AM
Post #4


New D.I.C Head

*
Joined: 14 Dec, 2006
Posts: 12

I would respectfully disagree with girasquid on this. Perl is a C like scripting language and is extremely powerful. PHP, to me, is more like an alternative to ASP in that it's main purpose in life is web oriented.

I program in both but find Perl much more flexible. I probably don't take advantage of all the available resources and write too much code myself, which means I spend more time in development that necessary. PHP seems to take a bit less time in development, but it also seems to run a bit slower. And it generally takes more code in PHP as compared to Perl. On the other hand, there are some very handy functions built into PHP that Perl programmers need to find or build themselves.

It's a matter of taste and function. Each language has its strong points and weak points. If the employer wants to use or is using Perl, that's what you'll need to know to get the job.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

KevinADC
post 6 May, 2008 - 12:30 PM
Post #5


D.I.C Head

Group Icon
Joined: 23 Jan, 2007
Posts: 168

PHP is actually a hybrid of perl, written specifically for web dev stuff. Over the years it has distanced itself from perl more and more. PHP is more like a toolbox now with specific tools for specifc tasks, perl is still more a machine shop. I guess that is what PHP codes and developers have wanted, a set of tools already made to get the job done faster. Perl coders tend to want to make the tools as well as use them, so in some case more dev time is involved, but CPAN has many tools already made and ready for use.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

rahulbatra
post 6 May, 2008 - 01:11 PM
Post #6


D.I.C Head

Group Icon
Joined: 28 Dec, 2005
Posts: 150

PHP initially started out as a wrapper around Perl and gradually became a language in its own right. It has evolved to a point it can pretty much do anything you'd expect from a scripting language, even besides web development.

Note: I'm not arguing for or against the design principles of PHP, merely stating what I think I know. No flaming please biggrin.gif

Perl started out as a text processing toolbox but has evolved into a full fledged programming language in its own right. People write all kinds of applications in Perl, including music players, Jabber clients etc. Note that this may also be achievable in PHP, you just would have to find libs for it. Most PHP libs are centered around web development.


As for your 2nd question, as girasquid said, you'd probably need a module like Tk for GUI applications in Perl. Even wxWidgets seems to do well in this regard. Perl being an interpreted language at its core, doesn't build an '.exe' file but the source pl file itself is executable. Note however, that there are tools which create some wrappers around the perl file to generate a Windows compatible exe file.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

KevinADC
post 6 May, 2008 - 02:07 PM
Post #7


D.I.C Head

Group Icon
Joined: 23 Jan, 2007
Posts: 168

I think Tk has been replaced with Tkx in activeperl 5.10 which is the most common distribution of perl for Windows. If you are using activeperl 5.8 I think Tk and Tkx are both included.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

spearfish
post 7 May, 2008 - 06:25 AM
Post #8


Monkey in Training

Group Icon
Joined: 10 Mar, 2008
Posts: 670

Here's something I found interesting



Attached thumbnail(s)
Attached Image
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

girasquid
post 7 May, 2008 - 06:37 AM
Post #9


Barbarbar

Group Icon
Joined: 3 Oct, 2006
Posts: 953

Yup - that article's a pretty interesting read in terms of comparing/contrasting Perl and PHP.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 5/16/08 09:26AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month