Perl
  Home arrow Perl arrow Page 2 - Beginning Programming Perl(s)
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
IBM Developerworks
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PERL

Beginning Programming Perl(s)
By: James Payne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 9
    2007-10-10

    Table of Contents:
  • Beginning Programming Perl(s)
  • Storing Data in A Variable
  • Quoth the Raven
  • List Data Types

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
     
    ADVERTISEMENT

    Dell PowerEdge Servers

    Beginning Programming Perl(s) - Storing Data in A Variable
    (Page 2 of 4 )

    There are many ways to store data in a variable. For now we will focus on the below example:


    $my_name = 'Hamburglar; ' # places the name Hamburglar in the variable

    $my_iq = 1000; # places the value 1,000 in the variable

    You'll note the # symbol followed by text above. This is known as a comment. Comments are lines of text that the computer cannot see. They are used to let other programmers (and even yourself) know what you intended a line of code to do. When the computer sees the # symbol, it skips the remainder of that line and moves on to the next.

    Try the following code:


    #!/usr/local/bin/perl

    $my_name = 'James';

    print "My name is below:n";

    print "$my_namen";

    The above code will print out the following to your screen:

      My name is below:

      James

    You will notice a few new additions to our code. The first is the line:


    #!/usr/local/bin/perl

    This must appear on the first line of every program you create. It tells the computer which directory to look in.

    In addition, we added the print command, which tells the program to print something to the screen. And lastly, we added the n or new line code. This simply informs the program to go to the next line and not print the next line of text on the same line.

    More Perl Articles
    More By James Payne


       · This is the second article in a series on Perl. It delves into the different Data...
       · ...when I view the article in my browser, in the code, the backslashes...
     

       

    PERL ARTICLES

    - Perl: A Continuing Look at Hashes and Multid...
    - Perl: Another Round with Hashes
    - Perl Hashes
    - Perl Lists: A Final Look at List::Util
    - Perl Lists: Utilizing List::Util
    - Perl Lists: The Split() Function
    - SQL and CGI with Perl and DBI
    - Perl Lists: More Functions and Operators
    - SELECT Queries and Perl
    - Perl Lists: More on Manipulation
    - Creating a Database with Perl and DBI
    - Perl: Sailing the List(less) Seas
    - Perl and DBI
    - Perl: Concatenating Text and More
    - Perl Text: Quoting Without Quote Marks

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway