iLTC Home
Bookmark iLTC!
iLTC Google Boards

Google Groups
Receive The Code in Email!



Categories

Perl
  • Perl Tutorials Beginners

    Javascript
  • Javascript Tutorials
  • Javascript Tutorials Beginners

    HTML
  • HTML Tutorials



  • I love the code... dot com
    20,101

    iLoveTheCode.com
    Perl > Perl Tutorials How To Easy > Finding the Length (Index Numbers) of an Array in Perl

    Finding the Length (Index Numbers) of an Array in Perl



    To get the number of pieces in an array:

    @ko=("London","Paris","France");

    $ji=$#ko + 1;

    print $ji;

    Which Prints:
    3


    -We named our array ko and stored 3 cities there.
    -The pound symbol # after the $ but before the ko says "what's the last index number of ko?"
    -The last index number is 2, remember index numbers start with 0.
    -We added 1 to get 3.


    Copy and Paste Perl Code:

    #!/usr/bin/perl

    print "Content-type:text/html\n\n";

    @ko=("London","Paris","France");

    $ji=$#ko + 1;

    print $ji;

    exit;



    Click HERE to comment or discuss at iLoveTheCode GOOGLE Group
    Previous Article: Exit a Script or Subroutine in Perl
    Next Article: Create a Subroutine in Perl





    Bulletproof Web DesignBulletproof Web Design

    Dan Cederholm

    New $26.39

    Learning Web DesignLearning Web Design

    Jennifer Niederst ...

    New $29.69

    CSSCSS

    David McFarland

    New $23.09

    CSSCSS

    Eric Meyer

    New $29.69

    jQuery in ActionjQuery in Action

    Bear Bibeault, Yeh...

    New $26.39

    DojoDojo

    Matthew A. Russell...

    New $26.39

    Struts 2 in ActionStruts 2 in Action

    Don Brown, Chad Da...

    New $29.69

    HTML, XHTML, and CSS, Si...HTML, XHTML, and CSS, Sixth Edition ...

    Elizabeth Castro

    New $23.09


    Of Interest:
  • To Sort an Array in Perl
  • Write a WHILE LOOP in Perl, Carefully
  • OPEN and WRITE a Data File in Perl
  • Add to the Beginning of an Array with Unshift in Perl
  • Javascript Slice - Use Slice to Get Items from an Array in Javascript
  • Javascript Join - Use Join to Make an Array into a String in Javascript
  • Mimic Typing from a Textfield in a Textarea with Javascript
  • Javascript Superscript Text
  • HTML Space
  • HTML Forms
  • HTML Tags
  • HTML Color Chart

  • More Articles:
  • Write a FOR LOOP in Perl
  • Delete a File Using unlink in Perl
  • Add, Subtract, Multiply, and Divide in Perl
  • What Environmental Variables are Available
  • onClick Javascript
  • Match with a Regular Expression, REGEX, in Javascript
  • Change a Form Field with Javascript
  • Reading Cookies using Javascript
  • Create a Function in Javascript
  • Make Text Bold Using HTML
  • HTML Body Tag
  • HTML Center
  • HTML Superscript Text

  • Search iLTC w/ Google





    Recent Articles

  • Javascript Focus Form Field
  • Javascript Lowercase Text
  • Javascript Uppercase Text
  • Javascript Superscript Text
  • Javascript Subscript Text
  • Make Text Blink Using Javascript
  • Make a String into a Link in Javascript
  • Javascript Italics Text
  • Javascript Bold Text
  • Javascript Redirect
  • HTML Frames
  • HTML Color Chart
  • HTML Link
  • Javascript Status Bar








  • Perl Programming - Javascript Programming - Maybe Some PHP - Free Scripts - ILoveTheCode
    All Content © 2006 iLoveTheCode.com


    Contact Chris | About this Site


    316,841
    Counter by iLoveTheCode.com


    Last Modified: Friday, 23-Jun-2006 07:23:13 EDT