develooper Front page | perl.beginners | Postings from February 2002

Arrays 1x3 or 3x1 - The real questions

Thread Next
From:
Steven M. Klass
Date:
February 12, 2002 08:50
Subject:
Arrays 1x3 or 3x1 - The real questions
Message ID:
200202121648.g1CGmZc25604@vivids1.nsc.com
Hi all,

Let's start off with some simple code..

my $arg = &SomeFunction ( my @arry = qw/one two three/)

sub SomeFunction {
	my @array = @_[0];
	for (my $i =0; i < @array; i ++ ) {
		print "$array[0][$i]
	}
}

Ok now I understand what the problem is, but I don't know how to fix it.  I 
only have a 1 x 3 array so only "one" gets printed - instead of the desired 
"one two three"..


How do I fix this?  This seems simple enough..  

Also if you want to suggest an alternate path, by all means.:)

Thanks a lot!

-- 

 Steven M. Klass
 Physical Design Manager

 National Semiconductor Corp
 7400 W. Detroit Street
 Suite 170
 Chandler AZ 85226

 Ph:480-753-2503
 Fax:480-705-6407

 steven.klass@nsc.com
 http://www.nsc.com


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About