Perl Education 2

Discussion in 'Archives' started by Hax4You, May 2, 2007.

Perl Education 2
  1. Unread #1 - May 2, 2007 at 3:51 PM
  2. Hax4You
    Joined:
    Feb 2, 2007
    Posts:
    741
    Referrals:
    0
    Sythe Gold:
    0

    Hax4You Apprentice

    Perl Education 2

    Part 2 of Perl Ed

    Ok, well this is basically the same.

    Meaning, all of the basics. I'll get into more advance another day.


    Numero Uno!

    How to create Programs with Perl using Statements.:

    Now, most Perl statements will go with something like this:

    - Testing "if this and that is true, then do whatever"
    - Loop *See in Perl Ed 1* "Keep doing this until I say to stop bitch"
    - Straight-Forward "Fart on Six"

    The most often seen in Perl is Straight Forward (AKA direct-action)

    This is what one script using "Direct-Action" may look like:

    Code:
      open(INFILE, $FileName) or die "The file $FileName could"  .
          " not be found .\n" ;
          $LineCount = $LineCount + 1;# SIMPLE PART (YAY!)
    In that *Example, the actions that will be done are open,die and the =. = Operator will be used plenty more times in Perl. What it is usually called is the assignment operator.

    The assignment Operator means:
    ------------------------------------------------------------------------


    Ending Statements of Perl:

    The way Perl can tell when a statement ends and begins is by using the ; (Semi-Colon)

    This statement ends with a ; :
    Code:
    $CharCount = 0
    There is also something neat with Perl. Some scripts cannot fit more that one statement on a line, but Perl can :)

    Like:
    $LineCount = 0;
    $CharCount = 0;
    $WordCount = 0;

    Can go all into one line:

    Code:
    $LineCount = 0; $CharCount = 0; $WordCount = 0;
    If any of you know your text editors, the *;* will act like a line break.

    Alright, well thats it for the second Perl Ed, soon (Hopefully) I will put up a third Perl Ed :D.
     
  3. Unread #2 - May 20, 2007 at 8:31 AM
  4. -------owned-------
    Joined:
    Jan 27, 2007
    Posts:
    1,225
    Referrals:
    0
    Sythe Gold:
    0

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

    Perl Education 2

    :D a nice tutorial
     
< looking for official or very trusted MM for free=) | lvl 70 ok stats lot of quests done :) >

Users viewing this thread
1 guest


 
 
Adblock breaks this site