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.
In reply to Re: Parse a block of text
by talexb
in thread Parse a block of text
by annie06
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |