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.
Java is a high-level, object-oriented programming language created by Sun Microsystems. In addition to allowing programs to define their own data types,...