Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Learning PERL

by BHARANI KRISHNAN (Initiate)
on Nov 23, 2016 at 11:40 UTC ( #1176411=perlquestion: print w/replies, xml ) Need Help??
BHARANI KRISHNAN has asked for the wisdom of the Perl Monks concerning the following question:

Sorry, I am a noobie to PERL and I have to know, What's the necessity to use PERL programming. What's so special in it and why one has to choose PERL.

Replies are listed 'Best First'.
Re: Learning Perl
by Discipulus (Monsignor) on Nov 23, 2016 at 11:55 UTC
    welcome to the monastery BHARANI KRISHNAN,

    Perl is the best language here around and Perlmonks is the sweetiest community.. but ask here is like to ask to the innkeeper if the wine is good..

    Perl is a multipurpose language and with Perl you can do many many different things. It is somehow a very succint language: few keystroke to get a big effect.

    Perl can run almost on every calculator you can normally have access to: it is preinstalled on most Linux distros, can run on windows (ActivePerl or even the by far preferable StrawberryPerl), mac ...

    CPAN contains a big big number of Perl modules and is one of the biggest software community here around.

    Take a copy of the old but still usefull Perl Cookbook to see many different complete applications presented in a recipe style.

    Take your free copy of Modern Perl to have a fres look to the language.

    A dedicated website perldoc.com offer you an introduction called perlintro

    The main Perl site hosts also a first steps tutorial

    Also see a note about case: Whats-the-difference-between-perl-and-Perl ie no more PERL..

    L*

    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
Re: Learning PERL
by wjw (Priest) on Nov 24, 2016 at 01:21 UTC

    I assume that your question might be restated as "What is/are the compelling reason(s) for using Perl.

    There are a lot of different answers, probably as many as there are Perl users. There are probably as many reasons not to use Perl, as many as there are folks who tried it and did not like it.

    Many of the most compelling reasons have already been mentioned:

    • Huge set of libraries which simplify routine tasks
    • Great support (ie perlmonks.org)
    • Cross platform
    • Very well documented
    • Active, it is still being developed/improved upon
    Just to reiterate a few.

    For me, it is simply a beautiful language. I can write code which works very quickly, get help when I need it, and do things my own way. That last is most important to me. I write code for my own use now days, so don't really have to fit into a 'norm'. While best practices are all well and fine, I frankly have a hard time reading others code when it deviates too far from what I have set up as my own standard. So being able to write in a way which maximizes my understanding of what the end result is and how I got there is important to me. There are few languages (that I have encountered) which are as flexible in this regard as Perl is.

    I hope that you find it both productive and enjoyable as you explore the language and meet the folks who make use of it.

    Best of luck to you!

    ...the majority is always wrong, and always the last to know about it...

    A solution is nothing more than a clearly stated problem...

Re: Learning PERL
by Phenomanan (Monk) on Nov 23, 2016 at 13:56 UTC

    Well, like any scripting language, Perl is primarily used to "glue" or modify other programs typically written in C or C++. However, unlike something like shell scripting, Perl does actually have functionality beyond that, and is used as a standalone solution by many people. This is the reason I prefer using Perl to other scripting languages. I feel less constrained, and have more versatility in regards to how to approach a problem.

    People in the industry nowadays say that Python will eventually phase out Perl, but I don't see that happening any time soon. Not to mention, as long as older systems need to be maintained, Perl will still have a long lifespan. It is definitely worth learning in my opinion, even just from an academic standpoint. I find that Perl requires a different problem-solving thought process than something like Java or C, and can help you develop as a programmer.

    I also want to add that when choosing a language, it is better to figure out what you are trying to solve or accomplish first, and then figure out which language would provide the best solution.

Re: Learning PERL
by Marshall (Abbot) on Nov 23, 2016 at 20:22 UTC
    Hi Bharani!

    I will talk about what I think is so cool about Perl. But first, my questions to you are: What kinds of computer problems are you trying to solve? What other languages do you know?

    If you are a business major, I would recommend learning how to make Excel and Word "sit down and bark", which means learning BASIC. The macro facilities of these programs use a form of BASIC which you can use to create spreadsheets of amazing features and complexity. I have even seen very nice "point and click" GUI user interfaces implemented as a spreadsheet!

    There is no single programming language that is "the answer" to all problems. I write code in a number of languages: Perl, Perl, C, C++, Java, Python, Assembly, low level micro-code (the "raw hardware" language that assembly instructions are implemented in) and roughly in that order. Perl appearing twice at the beginning is not a typo!

    Perl excels at a number of things, including (but certainly not limited to): anything to do with processing text, the web or dealing with an SQL Database.

    For text processing, what are called "regular expressions" (like wild cards on steroids) are implemented directly as part of the Perl language. Accessing a database is of course possible in say C or Java, but there will be a whole page of verbose code that is only a few lines in Perl.

    Two of the most common errors in programming are: "off by one errors" when iterating using indices in a loop and memory leaks (a piece of physical memory just essentially disappears never to be used or seen from again - in C++ this is an extremely common error). Perl has iterators and a memory management scheme so that usually these are not problems.

    Perl is "large language" with a lot of functions. I would not recommend Perl as a "first language". It is so flexible and so capable that it is hard for beginners to figure out what the right "subset" of the language to use for a particular situation.

    I find that functional Perl will run at maybe 1/3 the speed of C, but I can write the Perl code 5-10x faster. OO Perl has maybe an additional 30% performance penalty. For the vast, vast majority of my programming, being able to produce a correct solution quickly is much, much more important than the speed at which the code runs. When more performance is needed, I can tweak the Perl code to make it "good enough" or change algorithms rather than switching to C.

    PerlMonks is an excellent place to ask detailed questions. If you can find an organized class for beginners to take, that is a good way to get started. Perl requires a bit more "how to" guidance than just learning what the various functions do.

    I wish you well! PS: I guess Perl should be spelled in all caps, PERL like FORTRAN, they are both acronyms. But I am lazy when I type. Update: I guess that is not right, re:eyepopslikeamosquito's post. Perl it is.

      I guess Perl should be spelled in all caps, PERL like FORTRAN, they are both acronyms

      From whats the difference between "perl" and "Perl":

      perl is not an acronym
      Though there are several backronyms in use, please note that Larry originally chose the name "Perl" -- after going through every single word in the dictionary! -- arbitrarily for its positive connotations. Actually, he originally chose "Pearl", but that name was already taken.

      From the draft Oxford English Dictionary entry cited on history.perl.org:

      Perl Brit.
      Perl, perl, irreg. PERL
      Computing.
      perl n. ,
      arbitrarily chosen for its positive connotations, with omission of -a- to differentiate it from an existing programming language called Pearl. Coined by Larry Wall in the summer of 1987; the program was publicly released on 18 December of that year. Acronymic expansions of the name (such as Practical Extraction and Report Language and Pathologically Eclectic Rubbish Lister), though found in the earliest documention for the language, were formed after the name had been chosen. Coinage details confirmed by personal communication from L. Wall, May 2000. A high-level interpreted programming language widely used for a variety of tasks and especially for applications running on the World Wide Web. The form Perl is preferred for the language itself; perl is used for the interpreter for the Perl language.

Re: Learning PERL
by BillKSmith (Vicar) on Nov 23, 2016 at 20:18 UTC

    The biggest advantage of perl is probably its huge library of modules. In the past, most of us started learning perl because we needed access to DBI for database access, CGI for web applications or TK to develop GUI applications. We adopted it as our primary language because it supports applications from simple one-liners to large OO projects.

    Although I would no longer recommend CGI or TK for new applications (newer modules are preferred), perl modules are available for almost any application area.

    Bill

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1176411]
Approved by ww
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2017-12-18 07:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (473 votes). Check out past polls.

    Notices?