Perl Education

Discussion in 'Archives' started by Hax4You, Apr 24, 2007.

Perl Education
  1. Unread #1 - Apr 24, 2007 at 8:33 PM
  2. Hax4You
    Joined:
    Feb 2, 2007
    Posts:
    741
    Referrals:
    0
    Sythe Gold:
    0

    Hax4You Apprentice

    Perl Education

    First off, I would like to tell everyone that Perl will probably be the easiest "Programming Langauge" you will ever learn (Besides HTML).

    In my Perl Ed guide, you will not learn all of the advanced Perl things, like making word-processers, and whatever else. You will learn the basics of the Perl Programming language.

    Now, for those who don't know already, there are plenty versions of the Perl language, use Perl 5.8 please :).

    Download for Windows (ActivePerl 5.8):
    http://www.activestate.com/products/activeperl/

    Goto Download, click next at the next page, then go to the windows part on the left side and click the one that says MSI.

    Now, just to let you easy-goers know, there is a lot of typing involved in learning the Perl Language, since it is done in the... Command Prompt! Mwuahahahahahaha! OK, lets get this on.

    OK, if you had followed all directions in installing Perl, then you should know what to do.

    Open the command prompt window (Run... then type: cmd)

    Then, get to the Perl Directory by typing in C:/perl.

    Ok lets get it on now :) I was lying before.

    Ok, now, with Perl you can use one-line programs w/o having to put them in a word file.

    This useful option will be called the -e command, you could say this is just like MS-Excel, if you want to find the answer from 2 numbers (2*2=4) you would do this:

    Code:
    perl -e "print 2 * 2;"
    Activating a Statement (Telling Perl what to do):

    Code:
    print "For the thing $TheThing:\n";
    What the above ""Statement"" means that your telling Perl to print.

    Creating a Loop (Repeats a lot):

    Straight Loop (The world While will illustrate the end of loop):

    Code:
    while(<INFILE>)  {
       # Programming Parts ere'
    } # End of while(<INFILE>)  loop
    Once we leave the loop it'll read the program in the next line after the loop.


    Comments:

    Code:
    #!/usr/bin/perl -w
    # counter1.pl: This is one of the ways to count words, etc. in a word (text) file
    #   yay bob.
    When it sees a number symbol (#) in a line, Perl will think that everything after that symbol is a comment, so being itself, it will completely ignore that.

    Which means in this:

    Code:
    $Whateverthelineis = $_; # Save the line's contents
    IT will only pay attention to the text up to the semicolon and says who gives a shit to the comment.

    Ok, well, I hope that helped some people to learning the basic of the basics of Perl :D, I will make a second one another day :)
     
  3. Unread #2 - May 1, 2007 at 9:59 AM
  4. -------owned-------
    Joined:
    Jan 27, 2007
    Posts:
    1,225
    Referrals:
    0
    Sythe Gold:
    0

    -------owned------- Guru
    Banned

    Perl Education

    I still think that PHP is both easier and better :D
     
< Using Instance Variables and Colors in ObjectDraw | Antiproxy script now in effect; IP bans hold >

Users viewing this thread
1 guest


 
 
Adblock breaks this site