in reply to Questionon foreach loop syntax
It really would help if you could build sentences. Sentences are terminated by a single dot ("."). There should be no whitespace before punctuation, but one space after.
Anyway, the thing you are looking for is $_.
foreach (@array) { print $_; }
prints each element. You can also assign the elements to a variable like this:
foreach my $line (@array) { print $line; }
I have no idea what you could mean with your second question.
|
|---|