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,063

    iLoveTheCode.com
    Perl > Perl Tutorials How To Easy > Add to the Beginning of an Array with Unshift in Perl

    Add to the Beginning of an Array with Unshift in Perl



    @ko="Hello";

    unshift(@ko, "Hi");

    print @ko;


    Which Prints:
    HiHello


    -We created an array and named it ko because we like typing shorter names more than long ones.
    -We stored Hello in our array.
    -We used Perl's built-in unshift function to add to the beginning of our array.
    -We put the thing to be unshifted (or added) in quotation marks.
    -We used Perl's built-in print function.


    Copy and Paste Perl Code:

    #!/usr/bin/perl

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

    @ko="Hello";
    unshift(@ko, "Hi");

    print @ko;

    exit;



    Resources:
    Add to End of an Array with Push in Perl
    Create or Put Items into an Array in Perl
    Use the Perl PRINT FUNCTION



    Click HERE to comment or discuss at iLoveTheCode GOOGLE Group
    Previous Article: Add to End of an Array with Push in Perl
    Next Article: Combine, Put Two Arrays Together in Perl





    CSSCSS

    David McFarland

    New $23.09

    Struts 2 in ActionStruts 2 in Action

    Don Brown, Chad Da...

    New $29.69

    CSS MasteryCSS Mastery

    Andy Budd, Simon C...

    New $23.09

    Creating Web SitesCreating Web Sites

    Matthew MacDonald

    New $19.77

    jQuery in ActionjQuery in Action

    Bear Bibeault, Yeh...

    New $26.39

    CSSCSS

    Eric Meyer

    New $29.69

    Bulletproof Web DesignBulletproof Web Design

    Dan Cederholm

    New $26.39

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

    Elizabeth Castro

    New $23.09

    JavaScriptJavaScript

    David Flanagan

    New $31.49


    Of Interest:
  • Putting Two Strings Together, Concatenate
  • Encryption with the Crypt Function in Perl
  • Exit a Script or Subroutine in Perl
  • Delete a File Using unlink in Perl
  • Javascript Slice - Use Slice to Get Items from an Array in Javascript
  • Reading Cookies using Javascript
  • Javascript Superscript Text
  • Javascript Pop - Use Pop to Remove Items from the End of an Array in Javascript
  • Make Strikethrough Text Using HTML
  • HTML Frames
  • HTML Codes
  • Make Text Bold Using HTML

  • More Articles:
  • Opening and Reading a Directory in Perl
  • Exit a Loop with Last
  • Redirect to a Different URL in Perl
  • OPEN and READ a Data File in Perl
  • onClick Javascript
  • Close Window with window.close in Javascript
  • Focus a Window with self.focus in Javascript
  • Create a Function in Javascript
  • Opening a REMOTE WINDOW in Javascript
  • HTML Color Codes
  • HTML Tags
  • HTML Center
  • HTML Background

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


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