in reply to Parse a block of text
You're almost there. I think you probably want something like this:
#!/usr/bin/perl $infile = "my_file"; open (FILE, $infile) or die "Unable to open $infile: $!"; while(<FILE>) { if (/^Info I want/../^Start of Info/) { print unless (/^Start of Info/); } } close (FILE);
I haven't tested this .. but it should point you in the right direction. Note that a) I tested the open to make sure that the operation succeeded, and b) I didn't read the file into an array.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Parse a block of text
by annie06 (Acolyte) on Jul 07, 2008 at 20:40 UTC | |
by talexb (Chancellor) on Jul 07, 2008 at 21:14 UTC | |
by runrig (Abbot) on Jul 07, 2008 at 22:52 UTC |