On Sat, Aug 20, 2005 at 08:44:34PM +0530, Binish A R wrote:
> How can I force array context ... 
> like
> 
> # echo hello: world | perl -lne '$aref = split(/:/, $_); print $aref'
> 
> but thatz giving the length of the array ... I want $aref to be a reference 
> ...
> How is that possible ??

Very simple:

my @list1 = (1,2,3,4);
my @list2 = (5,6,7,8);

my @combined = (@list1, @list2);

my $ref_combined = [ @list1, @list2 ];


For mor info look in the Perl Cookbook section 11.0 (References and 
Records - Introduction)

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to