Ronnie has asked for the wisdom of the Perl Monks concerning the following question:
When I run this I get the following -#!/usr/bin/perl -w use strict ; # sub xxrc_ref { # use strict ; # my @tester = qw(a b c d) ; my $rarray = \@tester ; # return $rarray ; } # ####################################################### # Variables # ####################################################### # my $row = undef ; my @response = undef ; # print "\n\t<****** SOR ******>\n" ; # @response = &xxrc_ref() ; # print "\n\tResponse = @response\n" ; # for $row (@response) { print "\n\t@$row\n" ; } # print "\n\t<****** EOR ******>\n\n" ;
The problem I have with this is that the print of a,b,c,d should be on separate lines. The fact that they aren't makes me think I've got something horribly wrong but I can't see what. (I suspect a,b,c,d is being treated as a single element which is not what I want!) Any printable suggestions guys? Ronnie<****** SOR ******> Response = ARRAY(0x12e50c) a b c d <****** EOR ******>
Edit by castaway - fix broken code tag
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Array Reference (Again)
by Thelonius (Priest) on Oct 14, 2004 at 12:02 UTC | |
|
Re: Array Reference (Again)
by amrangaye (Friar) on Oct 14, 2004 at 12:24 UTC | |
|
Re: Array Reference (Again)
by perlcapt (Pilgrim) on Oct 14, 2004 at 13:22 UTC | |
by jonnybe (Scribe) on Oct 14, 2004 at 16:21 UTC | |
by TheEnigma (Pilgrim) on Oct 14, 2004 at 17:09 UTC |