This Season
 

How to Use Fundamental Data Types in Perl

The PERL programming language uses a few fundamental data types. This range of data types includes variables and other designations for routines and file maps. The data types in PERL are identified by a "sigil," one ASCII character at the beginning of the identifying name that lets programmers know which data type they are working with or looking at. Use PERL data types according to their roles in the language.

Related Searches:
    Difficulty:
    Challenging

    Instructions

      • 1

        Use scalars for strings, references, or other variables. The scalar is identified by a dollar sign, so $foo is an example of a scalar.

      • 2

        Utilize arrays to store scalars in ordered collections. The array, identified by a @, is a way to store variables in numeric order. @foo is an example of an array.

      • 3

        Try a hash or associative array to store scalars in a different way. A hash allows for an array where variables are not stored numerically but by specific "keys." %foo is an example of a hash identifier.

      • 4

        Use file handlers to manipulate files or data streams. The file handler is identified without a sigil and commonly in upper case letters: ex: FOO.

      • 5

        Apply subroutines for specific functions. A subroutine is not a variable but a block of "executable" code that variables can be passed to. A subroutine is identified by an ampersand: ex: &foo

    Tips & Warnings

    • Be aware of variables changing from integers to strings. PERL treats the same variables differently according to context, so that a number might be seen as an integer when tied to an addition operator, but as a string in other situations. Know that the scalar can have either of these properties.

    • Look for variable "names" to identify hash operations. While the array will just show a row of variables, in a hash, they will be named. Finding variable names in code clues you in that a hash has been created.

    Related Searches

    Read Next:

    Comments

    You May Also Like

    • How to Manipulate Data in Perl

      Perl is designed for reading and manipulating text data. It's easy to manipulate its three basic data structures (the scalar, the list...

    • How to Convert XLS to CSV on Perl

      Companies commonly use Excel to store tables of data. Often, those companies will find a use for that data that requires converting...

    • CIW Perl Certification

      Certified Internet Web Professional is an online educational resource offering certification in the Perl computer programming language.

    • How to Use Your Own Font on Your Perl Page

      In the past, custom fonts used as design elements were displayed as images in Web pages, a process that rendered the text...

    • How to Use Data Types in C++

      C++ offers seven fundamental data types, which can symbolize any type of information and are built into the compiler. Five of these...

    • How to Use References in Perl

      Perl 5 added the ability to manage complicated data in Perl. References essentially point to another data set without having to write...

    • How to Convert Perl Script to EXE

      The Perl programming language is an interpreted language. That means that the source code is evaluated when the program is run by...

    • How to Use Assignment Operators in Java

      Java has a number of assignment operators, or statements which adjust the value of a variable. Besides the simple assignment and initialization...

    • How to Read CSV Files in Perl

      CSV (Comma-Separated Value) is a special file format used to transfer spreadsheet data from one application to another. Data in CSV format...

    • What Is Strict Type Checking?

      Computer programming languages support a variety of data types that can be assigned to a variable. These data types may be a...

    • Data Types for Turbo C

      Data Types for Turbo C. Turbo C is a compiler and development environment for the programming language C. It came out in...

    • How to Convert Binary to Decimal in Java

      Java is a high-level, object-oriented programming language created by Sun Microsystems. In addition to allowing programs to define their own data types,...

    • How to Use Perl to Search a PDF Doc

      Perl scripts "crawl" across the web, sifting through the ocean of HTML pages for information, and inevitably encounter some of the millions...

    • How to Use GPS on a Blackberry Pearl

      The GPS on your Blackberry Pearl is an excellent navigational solution. Avoid getting lost and drop the bulk of a separate GPS...

    • Fundamentals of Voice & Data Cabling

      Fundamentals of Voice & Data Cabling. Eight million miles of nationwide fiber optic cables, thinner than a human hair, transmit pulses of...

    • C Tutorial: Data Types

      Dennis Ritchie developed a structured, general purpose programming language for Bell Telephone Laboratories that came to be known as C. C has...

    • How to Parse a CSV File Using VB

      The format CSV (comma separated values) is one of the most common for data files. A comma is used to delineate objects...

    • Blackberry Pearl Video File Types

      Blackberry Pearl Video File Types. So you got a new Blackberry Pearl and you want to test out its fully equipped media...

    Follow eHow

    Related Ads