Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us















Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


Creating References

September 28, 1998

There are several ways to create a reference depending on what type of object you want to reference.

The most basic method for creating a reference is to use the backslash (\) operator. For example, to create a simple scalar reference, you would use something like the following:

     #!/usr/local/bin/perl
     $name = "Selena Sol";
     $reference = \$name;

Notice the backslash character before $name.

Creating array, hash and subroutine references follows the exact same process such as:

     $array_reference = \@array_name;
     $hash_reference = \%hash_name;
     $subroutine_ref = \&sub_name;

References
Introduction to Perl 5 | Table of Contents
Dereferencing a Reference



Up to => Home / Authoring / Languages / Perl / 5




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers