Sunday, March 16, 2014

Perl Programming : Running your first Perl Program

There are 3 ways by which you can run a program :

1 INTERACTIVE INTERPRETER:

You can run a program in unix termilap just by enclosing the code in doublw codes

Syntax : $ perl -e "<<you perl code >>"


Example : $perl  -e  "print "hello from perl ";"


2 SCRIPT FROM THE COMMAND-LINE:
Type the code inside a textfile (use any text editor like vi r notepad) . save with ".pl" extention.run the file with filename.


Example :
C:> notepad script.pl

script.pl
#!/usr/bin/perl
print "hello from perl ";


C:> script.pl

3 INTEGRATED DEVELOPMENT ENVIRONMENT:

We can run Perl from a graphical user interface (GUI) environment.You can also use Eclipse Plugin EPIC - Perl Editor and IDE for Eclipse.

No comments:

Post a Comment