![]() |
Perl References![]() ![]() ![]() ![]() ![]()
A reference is a scalar value that points to a memory location that holds some type of data. Everything in your Perl program is stored inside your computer's memory. Therefore, all of your variables and functions are located at some memory location. References are used to hold the memory addresses. When a reference is dereferenced, you retrieve the information referred to by the reference. There are Six types of references. A reference can point to a scalar, an array, a hash, a glob a function, or another reference. The table below shows how the different types are valued with the assignment operator and how to dereference them using curly braces. The Six Types of References Reference Assignment $refScalar = \$scalar; $refArray = \@array; $refHash = \%hash; $refglob = \*file; $ref Function = \&function $ref Ref = \$ref Scalar; Eg.: Reference to a scalar value $x = 23; # create a reference $c = \$X; # dereferencing $z = $$c; print "$c\n"; will display: 23 How to Dereference $($refScalar} is a scalar value. &($refFunction} is a function location. $(${$refScalar} is a scalar value. Essentially, all you need to do in order to create a reference is to add the backslash to the front of a variable.
|
|
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. |