Perl
  Home arrow Perl arrow Beginning Programming Perl(s)
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 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: starstarstarstarstar / 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:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log 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


    Beginning Programming Perl(s)
    ( Page 1 of 4 )

    In the last article, you learned how to install Perl. It wouldn't make a lot of sense to install it on your computer if you never did anything with it, now would it? In this article, you'll take your first steps to becoming part of a wild and crazy breed -- a Perl programmer.

    The Perils of Programming Pragmatically in Perl

    Originally written as a way to make writing reports simpler, Perl has evolved to include web development, server scripts, and system administration. Some would say it has devolved into some other zany uses as well, like Perl Golf, a game programmers play to try and use the least amount of code possible to program specific challenges. There is also Perl Poetry, for all you wanna-be Shakespeare's and Edgar Allen TyPoes (haha wordplay!).

    Large websites such as Amazon, Ticketmaster, and IMDB.com use Perl. And in addition, you can use it to create graphical user interfaces.

    So grab a candle and a crow's quill, and some ink. And get ready to learn Perl the poetic way.

    (Note: I just read a poem in Perl that took the Billy Joel Song, "Uptown Girl" and made it "Uptown Perl").

    A Data Type by Any Other Name Would Still Hold Data

    Most programming languages are a real pain in the butt; they are nit-picky and like to play things by the book. Not Perl. Perl likes to sit around in its underwear drinking cans of Mountain Dew and making pyramids out of it. It likes to not take a shower for three days and eat a cold slice of that pizza it ordered a week ago and forgot to put in the fridge.

    In your average programming language, you have to define the type of data you are using. Not so in Perl. Perl doesn't care. It takes what it can get. In Perl, data types, or structures, are built off of the first data type: Scalar.

    Scalar Data Types

    A scalar, in simple terms, is a single piece of data. It could be a number, a letter, a novel, you name it. But it can only be that one thing. It's like a folder you create on your desktop. You give it a name and throw some data into it. Done.

    For now, we'll refer to that Folder as a variable. A variable holds data that you designate (or the user designates) that can be changed at a later data (hence the name variable). To let Perl know you are designating a variable as a scalar data type, you must place the $ in front of its name. You can choose to name your variable whatever you like, so long as it consists of only letters, numbers, and underscores. You may not begin the name with a number, however numbers can appear in the name. To keep things uniform, I would use all lowercase letters, and separate words by using our friend the underscore.

    Here are some sample names:


    $my_stuff

    $day_1

    $junk



     
     
    >>> More Perl Articles          >>> More By James Payne
     

       

    PERL ARTICLES

    - Basic Charting with Perl
    - Using Getopt::Long: More Command Line Option...
    - Command Line Options in Perl: Using Getopt::...
    - Web Access with LWP
    - More Templating Tools for Perl
    - Site Layout with Perl Templating Tools
    - Build a Perl RSS Aggregator with Templating ...
    - Looping, Security, and Templating Tools
    - Perl: Bon Voyage Lists and Hashes
    - Templating Tools
    - Perl: Number Crunching
    - Perl Debuggers in Detail
    - Debugging Perl
    - Perl: More on Lists and Hashes
    - Perl: Dimensional Lists





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
    Stay green...Green IT