<?xml version="1.0" encoding="windows-1252"?>
<node id="1007786" title="Re^3: Passing a reference from a subroutine." created="2012-12-07 11:39:52" updated="2012-12-07 11:39:52">
<type id="11">
note</type>
<author id="533863">
roboticus</author>
<data>
<field name="doctext">
&lt;p&gt;The syntax is clearly correct (as shown in the example below).  So if you're getting the proper data with Dumper in your for loop, then you're likely damaging the data between the Dumper call and your return statement.&lt;/p&gt;
&lt;c&gt;
$ cat t.pl
#!/usr/bin/perl
use strict;
use warnings;

sub get_data {
    my $data = shift;
    my @AoA = (1 .. $data);
    return \@AoA;
}

my $aref = get_data(5);
print join(", ", @$aref), "\n";

marco@Boink:/Work/Perl/Sudoku
$ perl t.pl
1, 2, 3, 4, 5
&lt;/c&gt;
&lt;p&gt;...[roboticus]&lt;/p&gt;
&lt;p&gt;&lt;i&gt;When your only tool is a hammer, all problems look like your thumb.&lt;/i&gt;&lt;/p&gt;</field>
<field name="root_node">
1007775</field>
<field name="parent_node">
1007783</field>
</data>
</node>
