
David C. Rankin wrote:
Listmates:
I don't know who I have to thank for this, but I think it was Anders who recommended that I look at perl after one of my last weird bash questions. I have a syntax question as I go though perl.
The situation. I read a file into an array and then go to reference each line.
my $NUM = 1; open FILE, ".bashrc" or die $!; my @array = <FILE>;
How is it legal that I can reference the array element either as @array[element] or $array[element]?:
while (@array[$NUM]) { print "$NUM : @array[$NUM]\n"; $NUM++; }
while ($array[$NUM]) { print "$NUM : $array[$NUM]\n"; $NUM++; }
From what I've read, it seems like the list $array[element] would just return the number of characters in the list $array[element] not the text itself. How should I think about this?
I gave up on perl. It makes my brain hurt -- like trying to read 1970's era BASIC code.
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org