[EMAIL PROTECTED] wrote:
I'm a nearly absolute beginner to Perl,

Then this site ought to be useful: http://learn.perl.org/

and a lot of the text manipulation things confuse me.

Really? Which things specifically, and in what way?

I have a large text file with
information essentially broken into lines like this:

findable text with a regexp
information I care about
more findable text

There are plenty of sections like this in the file. How can I write a
program that opens the file then searches for the middle line and
prints it to a new file?

What have you tried so far?

Example:

    open my $IN,  '<', 'infile.txt' or die $!;
    open my $OUT, '>', 'outfile.txt' or die $!
    while ( <$IN> ) {
        print $OUT scalar <$IN> if /^findable/;
    }

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

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


Reply via email to