tags:

views:

281

answers:

10

I want to learn Python and Perl, buy I don't know where need I use it.

I can use PHP to build a website or use Java/.Net to build server-side applications or use JavaScript to write dynamic web pages.

Where can I use Python and Perl?

+11  A: 

http://codepad.org/ is a great place to play with a lot of languages. It's a online compiler, editor, and will show you the output of your program.

I use it to test out some of the code I write in answers here, especially for some code golf questions.

Further, you can save your code there, and view other people's code - for instance here's the collection of FizzBuzz programs, in many languages:

http://codepad.org/fizzbuzz

If you create an account you can create a 'project' and associate a subdomain with it for ease of use, such as myproject.codepad.org.

Adam Davis
codepad.org is a great suggestion - very useful.
Mike Cialowicz
+3  A: 

You can write dynamic websites with python and perl, too - if this gives you motivation:

The MYYN
Mason and Django are merely one sample of each language's many (many many many) web libraries. An exhaustive list is not practical.
daotoad
+5  A: 

The best way to learn is to install both languages and try them out for yourself. Both python and perl can be invoked from the command line.

Dive Into Python should be more than enough to get you started. Perl comes with extensive documentation you can access from the command line or on the web. For further Perl resources, see learn.perl.org

What is the best way to learn? Start with a small project, or tutorial. Python is great for both scripting as well as large projects. As other have already suggested, check out Django if you're looking to build a complete web application in Python.

Mike Cialowicz
A: 

You make an invalid and arbitrary distinction between languages. Web sites and server side applications can be written in perl and python. So can desktop apps, command line scripts, and any other sort of thing you might want to try to convince your computer to do.

Take a look here: http://bitbucket.org/repo/all/?name=python or here: http://github.com/search?langOverride=&q=python&repo=&start_value=1&type=Repositories for a starter list of things being done with python.

jcdyer
A: 

With perl also you can build web site (check the perl module CGI in CPAN). I think similarly one can use python to build web sites (but I don't have good idea about this).

That being said one way to get started with would be, writing small scripts (python/perl) to automate some of the day to day tasks. Is there something which is currently being done using a shell script probably you can port it to run in perl.

sateesh
With Perl it is better to use CGI::Application or Catalyst to create sites.
Alexandr Ciornii
CGI isn't that bad a way to start. For a beginner, CGI::App and Catalyst present a rather daunting learning curve.
daotoad
+8  A: 

You can use both Perl and Python to build:

  • Complete web applications and frameworks
  • Standalone utility programs
  • Server side processing code
  • GUI programs

etc etc. The way to learn either Python or Perl is no different than the way to learn any other language: Get a good book, play around with good examples and build something.

Sinan Ünür
+1  A: 

If you want an application to build in perl, that perl is suited for, start parsing log files and reporting the data: perl is uniquely suited for this kind of work, due to strong regular expressions, and ability to work easily with files.

I've never really found a problem suited for python that I didn't have a better solution for in javascript, perl, php, M, or C already. I'll be interested in what others have to say.

MikeEL
+1  A: 

Find an itch and scratch it. Many of my scripts fall into one of these two categories:

  • Automating a task that I'm tired of doing by hand
  • Parsing some text files and generating a report

There's a lot more that you can do -- Perl and Python are well-suited to a wide variety of tasks -- but small tasks like these are excellent places for learning the language.

Michael Carman
+1  A: 

There is a good website called Project Euler, which provides a lot of mathematical puzzles that require some programming to solve. The website describes itself as:

Project Euler is a series of challenging mathematical/computer programming problems that will require more than just mathematical insights to solve. Although mathematics will help you arrive at elegant and efficient methods, the use of a computer and programming skills will be required to solve most problems.

When you sign up, you choose the language that you will be using to solve problems, and there is also a website community so after you solve each problem you can see other people's solutions and chat about the problem.

The problems start off simple enough with tasks like

Find the sum of all the even-valued terms in the Fibonacci sequence which do not exceed four million.

or

Calculate the sum of all the primes below two million.

and quickly grow in difficulty.

Check it out! The first python program I wrote was for this website.

Roman Stolper
A: 

Perl : Perl doc site

Python: Python doc site

That's all you need.