in reply to Re: File read and strip
in thread File read and strip

The line breaks are intentional to make the final file more readable when I format it.
What does using the {parameter?} "my $line" before the (@array) do?
And, let's see if I have any idea what's going on, the second line skips a line if it starts with a #?

Thanks!

Replies are listed 'Best First'.
Re^3: File read and strip
by markh (Scribe) on Nov 14, 2006 at 20:30 UTC
    The line:
    foreach my $line (@array) {
    assigns the value from the next item in @array to the variable $line. I find this makes it eaiser to see what you are doing, rather than using $_, which I find non-intuitive.

    Yes, you are correct, that next line of code skips anything that starts with a #, so that only lines from your file that are not comments are inserted into the array that you are intending to send to the output file.