CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Advanced: Re: [gooroo175] reference on reference array: Edit Log



BillKSmith
Veteran

Nov 8, 2010, 12:06 PM


Views: 2146
Re: [gooroo175] reference on reference array


Code
use strict;  
use warnings;
use Data::Dumper;

my $var1 = 1;
my $var2 = 2;
my $var3 = 3;
my $refRef = [\($var1, $var2, $var3)];
print Dumper $refRef;



output:

Code
 $VAR1 = [  
\1,
\2,
\3
];





Note: the square brackets return a reference to an array.


rovf raised a good point. Line 8 of the above code is exactly what you asked for, but may not be what you need.
Good Luck,
Bill

(This post was edited by BillKSmith on Nov 9, 2010, 7:56 AM)


Edit Log:
Post edited by BillKSmith (Veteran) on Nov 9, 2010, 7:56 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives