![]() |
Types of Variable![]() ![]() ![]() ![]() ![]()
Scalars:Holds one number (integer and real) or string value at a time. Scalar variable names always begin with a $.
In double quoted strings, characters with a backslash prefix are replaced by a single sepecial character. For example, \n becomes a newline. Perl displays a single quoted string verbatim without replacing variable with corresponding values. You might use single quotes to print string contain single characters, such as $ and @. For example, print $num copies of books'; will be printed as num copies of books Third type of string quoting is useful when you want to display the output operating system command. Suppose that you want to store the output UNIX Is command ( Is command lists the list of files in the current direct a scalar variable named $out. You can do so by using the following Perl start $out = 'Is'; Getting Values in Scalar Variables The example will make a variable assignment and then change that variable value using a second assignment. The second assignment will increment value by five. $numberOf Rooms = 23; $numberOf Rooms = $numberOf Rooms + 5; Array Variables
Array variable names always begin with an 0 character. The rules for array variables are the same as those for scalar variables. Assigning Values to Array Variables You use the equals (=) sign to assign values to array variables just like values. OemptyArray=();
perl with extend the associative array as needed when you assign values to keys. An internal table is used to keep of which keys are defined. If you try to access an undefined key, Perl will return a null or blank string.
|
|
PERL Perl Program Data Types Types of Variables Operator Types Functions String Functions Array Functions Expressions Statement Blocks The if Statement Unless Statement While Loops Until Loop For Loop Foreach Loop Jump Keywords Subroutines Perl References Die Function Exit Function Localtime Function Standard Files File Test Operators File Functions Opening Files Reading into Hash Printing Revisited Globbing Splitting a Record into Fields Perl's Special Variables Regular Expression Simple True-False Searches Inexact Matches in Regular Expressions Matching Any Character Characters with Class Special Locations Quantifiers Greedy Matching Modifiers Localtime Function Subsituations Letter for Letter Translations Generating A Simple Report Defining a Report Template Specifying the Picture Line Specifying the Argument Line Adding a Header Writing the ReportDomain Names Home Importance of a domain name How does a web domain name work? Domain name syntax Choosing a domain name Domain Transfer Domain Parking IP AddressWeb Design HTML DHTML XML JAVASCRIPT VBSCRIPT PHOTOSHOPWeb Hosting Web Server Web Server Software Microsoft Internet Information Server Web hosting ISP Shared web hosting Virtual web hosting Dedicated web hosting Web hosting colocation Managed web hostingE Commerce Principles of E-Commerce E-Banking Electronic Payment System E-Security Credit Cards Smart Cards
The Mailbox POP Server SMTP Server IMAP Protocol |
| Home | Web Hosting | Web Design | Sitemap |
| Copyright (C) 2007. Web Domain design hosting. All rights reserved. |