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...
    20,074

    iLoveTheCode.com
    Perl > Perl Tutorials How To Easy > To Reverse an Array in Perl

    To Reverse an Array in Perl



    To reverse an array in Perl:

    @gy=("Paris", "London", "Tokyo");

    @gy=reverse(@gy);

    print @gy;


    Which Prints:
    TokyoLondonParis


    -We named our array gy because we don't like typing long array names.
    -We said to reverse the array gy and store it back into gy.
    -We said to print gy which now has put our array in reverse order.


    Copy and Paste Perl Code:

    #!/usr/bin/perl

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

    @gy=("Paris", "London", "Tokyo");

    @gy=reverse(@gy);

    print @gy;


    exit;


    Resources:
    To Sort an Array in Perl
    Splitting an ARRAY in Perl


    Click HERE to comment or discuss at iLoveTheCode GOOGLE Group
    Previous Article: To Sort an Array in Perl
    Next Article: Encryption with the Crypt Function in Perl





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

    Eric Freeman, Elis...

    New $26.39

    DojoDojo

    Matthew A. Russell...

    New $26.39

    CSSCSS

    Eric Meyer

    New $29.69

    Pro CSS and HTML Design ...Pro CSS and HTML Design Patterns

    Michael Bowers

    New $29.69

    Learning Web DesignLearning Web Design

    Jennifer Niederst ...

    New $29.69

    CSSCSS

    David McFarland

    New $23.09

    JavaScriptJavaScript

    David Flanagan

    New $31.49

    Creating Web SitesCreating Web Sites

    Matthew MacDonald

    New $19.77


    Of Interest:
  • What Environmental Variables are Available
  • Add to the Beginning of an Array with Unshift in Perl
  • Matching at the Beginning and End
  • OPEN and WRITE a Data File in Perl
  • Focus a Window with self.focus in Javascript
  • Create a Function in Javascript
  • Javascript Redirect
  • Javascript Referrer
  • Make a Line Return Using HTML
  • HTML Link
  • HTML Title Tag
  • HTML Space

  • More Articles:
  • Create an Array of Specific Numbers in Perl
  • Renaming a File with Perl's RENAME Function
  • Encryption with the Crypt Function in Perl
  • Putting Two Strings Together, Concatenate
  • onClick Javascript
  • Use onMouseOut in Javascript
  • Call your Function in Javascript
  • Mimic Typing from a Textfield in a Textarea with Javascript
  • Use onLoad to Call More than One Function with Javascript
  • Make Strikethrough Text Using HTML
  • HTML Subscript Text
  • HTML Codes
  • HTML Tags

  • 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,814
    Counter by iLoveTheCode.com


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