www.perl.com
Perl Programming
Scalars
  • May be declared in a local scope with a my qualifier
    • Required under use strict
    • Helps avoid common mistakes
    • Limits the variable to its enclosing block
    • Declaring a variable without assigning a value leaves its value undefined
    • May declare a variable and assign a value in the same statement

        use strict;

        my $apple_variety;                # Value undefined
        $apple_variety = "Red Delicious"; # Defined
        $apple_vareity = "Granny Smith";  # Error

        my $apple_color = "red";          # Declare and define
      
http://stuff.mit.edu/iap/perl/