gube has asked for the wisdom of the Perl Monks concerning the following question:
Hi monks,
While, dereferencing and printing the reference array i am getting the exact values stored in the array. But, while dereferencing the array and printing by concatinate with some text i am getting length of the array do i need some changes in my code ?
#!/usr/local/bin/perl use strict; use warnings; my @a = qw/a b c/; my $a = \@a; print @{$a}; # Printing correct output abc... # It prints length of the array why? print "Dereference and Printing the Reference array " . @{$a};
2006-04-26 Retitled by planetscape, as per Monastery guidelines
Original title: 'Dereferencing the array and printing by Concatinate?'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Dereferencing the array and printing by Concatenation?
by gaal (Parson) on Apr 24, 2006 at 12:33 UTC | |
by gube (Parson) on Apr 24, 2006 at 12:44 UTC | |
|
Re: Dereferencing the array and printing by Concatenation?
by TedPride (Priest) on Apr 24, 2006 at 12:45 UTC | |
|
Re: Dereferencing the array and printing by Concatenation?
by davorg (Chancellor) on Apr 24, 2006 at 12:43 UTC | |
|
Re: Dereferencing the array and printing by Concatenation?
by sen (Hermit) on Apr 24, 2006 at 12:35 UTC |