Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Lean back in your chair. Breathe. For a moment, just sit there and breathe.

From reading your post, I get the impression that you want too much, too quick. So sit back, relax, and hear me out.

Since Perl 1, back in the eighties, Perl has come a long way. It's a general purpose programming language, that strives to make easy things easy and hard things possible. Unfortunately, that comes at a price. To make easy things easy, Perl has to be a lot of things. That can be imitating.

For example, is Perl an OO programming language? Yes and no: Perl has built-in support for OO, and modules like Moose (edit: fixed linkage) extend Perl's OO system even further, but it's not an OO language in the sense that everything is an object.

Is Perl a functional programming language? Yes and no: functions such as grep, map, and sort take another function as an argument, and you can even write your own subroutines that do that, but functions aren't really first-class citizens. You can pretend they are by using references, if you want, though. This might sound like black magic right now, but given enough time, you'll find that you're throwing around references in your code like you've never done anything else.

Keep breathing. Everything's all right.

Then, is Perl an event-driven language? Well, it's not that hard to write an event-driven script, but strictly speaking Perl is not an event-driven language, although there are event-driven frameworks out there.

So is Perl at heart an imperative language, then? Well, yes, if you want it to be.

In short, Perl offers you, the programmer, a lot of ways to solve a lot of problems. Whichever way you pick entirely depends on what seems most natural for the problem at hand. But Perl tries to be in your way as little as possible, just handing you a bunch of tools that you can use as you see fit.

For example, there are no stacks or queues in Perl, but there are arrays, and there are functions such as pop, push, shift, and unshift. An array + push + pop is just like a stack, ad a array + push + shift perfectly mimics a queue. Minimalist tools that at the same time provide a great deal of flexibility.

If you want to learn Perl, you'll have to learn about the tools that Perl gives you. Once you have a solid grasp on those, you'll be able to combine them into something that does what you want. So pick up a good book, work your way through Getting Started with Perl (as suggested per blue_cowdawg), play with the examples and see how your changes affect the way the program runs, make mistakes and learn from them, and of course ask questions here if there's something you don't understand or if there's something you need to know.

But take your time. Don't try to get it all at once. It took about two decades for Perl to get where it is now, nobody expects you to pick it up overnight.

Once you get a basic understanding of the toolset that Perl is, you'll be able to make those tools work for you. And you don't even have to know all there is to know: Perl is friendly enough that it lets you write working programs even while you're just a novice Perl hacker, and you will find that the language grows with you as you grow into the language. You just sit back, keep breathing calmly, and give Perl a chance.

In reply to Re: Out gunned - and crashing by muba
in thread Out gunned - and crashing by BingFarz

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others examining the Monastery: (4)
    As of 2018-03-22 19:57 GMT
    Find Nodes?
      Voting Booth?
      When I think of a mole I think of:

      Results (284 votes). Check out past polls.