Tuesday, February 1, 2011

Configuring Perl in Ubuntu

Hi All,

This post explains how to configure perl in Debian based distros.

Open synaptic and search for perl and install it.

Issue this command first:

1. whereis perl
Copy the output of this command as your first bang line for your perl script.

Next perl -v command
This will issue which version of perl is being installed.

Then open gnome-terminal or your console and write this simple perl program. Copy as is.

#!/usr/bin/perl -w


print "hello world";

Name this file as a.perl. In the terminal run this command: perl a.perl


Enjoy,
Ananth S Gouri

1 comment:

  1. Hello Ananth. I have some Perl scripts on Ubuntu. Ubuntu is running Apache2. This files doesn't have a file extension like .perl or .pl. First line of each file is #!/usr/bin/perl -wT. I plan to use them in this way: From a browser type IP of Ubuntu machine, followed by name script, something like this http://192.168.10.105/bin/showme. Showme is the name of one of my Perl scripts. My problem is, that browser don't runs my Perl script, only shows its content, just like a text file. Perl, appears correctly installed. Any advice is welcome.

    ReplyDelete