Perl

Manikandan Thiagarajan
Manikandan Thiagarajan used Ask the Experts™
on
When we go for perl
What is the advantages of perl
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2016

Commented:
Why ask in the Java TA?
Manikandan ThiagarajanSenior consultant

Author

Commented:
which area i want to ask
i could not able to find perl option
Top Expert 2016

Commented:
Why Diversity in Tech Matters

Kesha Williams, certified professional and software developer, explores the imbalance of diversity in the world of technology -- especially when it comes to hiring women. She showcases ways she's making a difference through the Colors of STEM program.

Top Expert 2009
Commented:
Perl is fast for prototyping and has terse syntax for key features and data structures like regular expressions, lists, hash tables, file opening/close string concatentation, etc.

It is a very expressive language at the expense of being readable in some cases, but often it is up to the programmer as to how he writes the code. You can write good code in Perl and you can write unreadable code, just as in any languages.

Perl is optimized for writing solutions fast in few lines of code. That is what you want when prototyping. After you have a working prototype, you can then decide if it needs optimization or not. If so, port it to another language like C/C++/Java.

Perl also allows one-lines and simple scripts, which I feel is a benefit. It does not enforce a program structure like other languages.

Top Expert 2009

Commented:
Another advantage of Perl is the huge library of APIs available (CPAN). www.cpan.org
No other language has an equivalent at this time.

@OP, its really a question of "Perl's advantage over what? "
In terms of what it can do, there is really no significant real advantages to language like Python, for example, as both can do similar things. Same with ruby, Java etc...
Then after all these it really comes down to aesthetics. For example, whether you like the syntax, whether you find your code readable and understandable after writing with those languages, whether those programming constructs make programming  easier...etc...

ozo
Most Valuable Expert 2014
Top Expert 2015
Commented:
Found in perl5/5.10.0/pods/perlfaq1.pod
   How does Perl compare with other languages like Java, Python, REXX, Scheme,
       or Tcl?
       Favorably in some areas, unfavorably in others.  Precisely which areas
       are good and bad is often a personal choice, so asking this question on
       Usenet runs a strong risk of starting an unproductive Holy War.

       Probably the best thing to do is try to write equivalent code to do a
       set of tasks.  These languages have their own newsgroups in which you
       can learn about (but hopefully not argue about) them.

       Some comparison documents can be found at
       http://www.perl.com/doc/FMTEYEWTK/versus/ if you really can't stop
       yourself.
Suhas .Senior QA Manager
Commented:
 When we go for perl?
* A scripting language used basically for text  and data manipulation    
* Majorly used by system administrators and web programmers
* Glue and gateway between systems, databases, and users.
* With huge number of modules in CPAN these days, you can also use for GUI automation ( Win32::GuiTest ) and internet explorer automation ( WIn32::IEAutomation ), GUI creation using ready tool ( Win32::GuiLoft , Tk etc ).
* Different database extraction or adding data.
* Web development using CGI Perl etc.

What is the advantages of perl?
  * It is an interpreted language      
*  Perl is a composition of sed , awk , C , Shell and English and many more .  
* It does not need a special compiler to turn the scripts into working code
* Easy to learn and implement  
  * Perl is portable
* Perl is free    
Top Expert 2016
Commented:
Let's say you wanted to write something system-oriented on some flavour of Unix which was too complex for a shell script. Perl would be your best bet since you can be almost certain that there will be a Perl environment sitting there waiting for you
Manikandan ThiagarajanSenior consultant

Author

Commented:
any server is needed for perl to execute

what is the use of cgi with perl
ozo
Most Valuable Expert 2014
Top Expert 2015

Commented:
If by cgi, you mean Common Gateway Interface, the protocol can be used by any language.
If you mean the CGI.pm perl module, it is not much use to run without perl.
Suhas .Senior QA Manager

Commented:
No need of server for perl to execute.
You can install and run on any machines.
Manikandan ThiagarajanSenior consultant

Author

Commented:
What are the advantages with cgi perl
which version i want to download perl and execute

cold you give me a fair idea about that
i am new to perl
ozo
Most Valuable Expert 2014
Top Expert 2015

Commented:
The Common Gateway Interface doesn't care or know whether perl or any other language was used.
the advantage of perl would be to the programmer not to cgi.

The laterst released version of perl is 5.10.0
that would probably be the best version to use
Manikandan ThiagarajanSenior consultant

Author

Commented:
why they are called cgi perl
when we go for cgi for perl
is it perl is the scripting languageor programming language
Suhas .Senior QA Manager

Commented:
CGI interface ( use CGI.pm ) with perl is called as CGI Perl ( mainly used for web development )
Its basically scripting language, but can also be used as programming language.


Manikandan ThiagarajanSenior consultant

Author

Commented:
what is the role of cgi for perl in webdevelobment
in website perl is used for serversideprogramming or serverside scripting
Could you explain with detail
Senior QA Manager
Commented:

CGI.pm is a stable, complete and mature solution for processing and preparing HTTP requests and responses. Major features including processing form submissions, file uploads, reading and writing cookies, query string generation and manipulation, and processing and preparing HTTP headers. Some HTML generation utilities are included as well.  
CGI.pm performs very well in in a vanilla CGI.pm environment and also comes with built-in support for mod_perl and mod_perl2 as well as FastCGI.  
It has the benefit of having developed and refined over 10 years with input from dozens of contributors and being deployed on thousands of websites. CGI.pm has been included in the Perl distribution since Perl 5.4, and has become a de-facto standard.

We can say its programming....


There are two styles of programming with CGI.pm( In general uses OO style),

1. an object-oriented style and a function-oriented style. In the object-oriented style you create one or more CGI objects and then use object methods to create the various elements of the page. Each CGI object starts out with the list of named parameters that were passed to your CGI script by the server. You can modify the objects, save them to a file or database and recreate them. Because each object corresponds to the "state" of the CGI script, and because each object's parameter list is independent of the others, this allows you to save the state of the script and restore it later.

2. In the function-oriented style, there is one default CGI object that you rarely deal with directly. Instead you just call functions to retrieve CGI parameters, create HTML tags, manage cookies, and so on. This provides you with a cleaner programming interface, but limits you to using one CGI object at a time. The following example prints the same page, but uses the function-oriented interface. The main differences are that we now need to import a set of functions into our name space (usually the "standard" functions), and we don't need to create the CGI object.

For more details, please go through http://search.cpan.org/~lds/CGI.pm-3.43/CGI.pm 
Manikandan ThiagarajanSenior consultant

Author

Commented:
CGI-PM

What is meant by PM
  is it perl module?
Suhas .Senior QA Manager
Commented:
Yes its perl module. A correction its not CGI-PM its CGI.pm ( dot )
All modules in perl are stored with .pm extension.


Manikandan ThiagarajanSenior consultant

Author

Commented:
we have write a program or script in perl in webdevelopment

what is the purpose of cgi for perl

Could you explain the functionality of each.
ozo
Most Valuable Expert 2014
Top Expert 2015
Commented:


CGI, the Common Gateway Interface is an agreement between HTTP server implementors about how to integrate such gateway scripts and programs.
http://hoohoo.ncsa.illinois.edu/cgi/intro.html


CGI.pm is a perl module.  it uses objects to create Web fill-out forms on the fly and to parse their contents. It provides a simple interface for parsing and interpreting query strings passed to CGI scripts. However, it also offers a rich set of functions for creating fill-out forms. Instead of remembering the syntax for HTML form elements, you just make a series of perl function calls. An important fringe benefit of this is that the value of the previous query is used to initialize the form, so that the state of the form is preserved from invocation to invocation.
http://www.broadinstitute.org/ftp/pub/software/WWW/cgi_docs.html

@OP, you can read up all these basic stuff from the internet. you are not going to ask every little thing you don't know here, do you?

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial