1. Home
  2. Computing & Technology
  3. Perl

Scalar

From , former About.com Guide

Definition: Perl's scalar is a container that can hold a single value. The scalar is assigned a variable name, preceded by the $ character. The variable name may only contain letters, numbers, or the underscore character. Because perl is a loosely typed language, there is no need to declare the type of data that is stored in a scalar. Perl will determine the type based on context. The following are some examples of valid variable names:
$theTotal = 25;
$counter = 1;
$perl_scalar_1 = "My Data."
Explore Perl
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Perl
  4. Perl Tutorials
  5. Perl Glossary
  6. Scalar

©2009 About.com, a part of The New York Times Company.

All rights reserved.