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



  • Perl with cheese...
    123,698

    iLoveTheCode.com
    Perl > Perl Tutorials How To Easy > What's in an Array, Index Numbers

    What's in an Array, Index Numbers



    @ft=("London", "Paris", "Tokyo");
    print "$ft[0]";

    Which prints:
    London


    -The array we named @ft has three cities stored in it.
    -The INDEX NUMBERS start with zero, so $ft[0] equals London, $ft[1] equals Paris and so on.


    NOTE: We didn't need to SPLIT the array, because it was already in pieces. Had the array looked like this: "London,Paris,Tokyo" with quotes around the whole thing, we would have needed to split like this:

    @ft=split(/,/, "London,Paris,Tokyo");


    Copy and Paste Perl Code:

    #!/usr/bin/perl

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

    @ft=("London", "Paris", "Tokyo");
    print "$ft[0] ";

    @ft=split(/,/, "London,Paris,Tokyo");

    print "$ft[2]";


    exit;


    Click HERE to comment or discuss at iLoveTheCode GOOGLE Group
    Previous Article: Substitute in Perl
    Next Article: Opening and Reading a Directory in Perl





    JavaScriptJavaScript

    David Flanagan

    New $31.49

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

    Elizabeth Castro

    New $23.09

    HTML & XHTMLHTML & XHTML

    Chuck Musciano, Bi...

    New $29.99

    HTMLHTML

    Gary B. Shelly, Th...

    New $84.55

    Head First HTML with CSS...Head First HTML with CSS & XHTML

    Eric Freeman, Elis...

    New $23.99

    CSS MasteryCSS Mastery

    Andy Budd, Simon C...

    New $23.85

    jQuery in ActionjQuery in Action

    Bear Bibeault, Yeh...

    New $26.39

    Information Architecture...Information Architecture for the Wor...

    Louis Rosenfeld, P...

    New $26.39

    CSSCSS

    David McFarland

    New $23.09


    Of Interest:
  • Check for Existing File in Perl
  • Create a Subroutine in Perl
  • Getting Server Time in Perl
  • To Sort an Array in Perl
  • Formatting Time in Javascript
  • Javascript Italics Text
  • Mimic Typing from a Textfield in a Textarea with Javascript
  • Get Formatted Time in Javascript
  • HTML Title Tag
  • HTML Tags
  • HTML Frames
  • Make Text Bold Using HTML

  • More Articles:
  • Putting Two Strings Together, Concatenate
  • OPEN and WRITE a Data File in Perl
  • Finding the Length (Index Numbers) of an Array in Perl
  • Add to End of an Array with Push in Perl
  • onClick Javascript
  • Annoy Users with onBlur in Javascript
  • Get Formatted Time in Javascript
  • Select All or Highlight Text Fields and Textareas Using Javascript
  • Opening an Alert Box in Javascript
  • HTML Image
  • HTML Tags
  • Make a New Paragraph Using HTML
  • HTML Tables

  • 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


    420,459
    Counter by iLoveTheCode.com


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