in reply to Re: Perl RE; how to capture, and replace based on a block?
in thread Perl RE; how to capture, and replace based on a block?
Sorry. I just
in an open xterm. After several failures, and no more ideas. I closed the xterm, and asked for help. I didn't think it'd be of any use in the request.cat ./FILE.html | perl {...}
I've since read every single reference in the Perl documentation, and while I think I've got the RE part down. I'm quite sure I don't know how to feed Perl the file properly to do any more than eat a single line at a time.
So let me have another go at it. The following
won't work as#!/usr/bin/perl -w #retest.pl # my feeble attempt to a multi-line RE in Perl $regexp = shift; while (<>) { print if /$regexp/; }
because shift will only manage input one line at a time. Attempts to figure how to make use of psed, and s2p, have failed miserably.# ./retest.pl \</\div\>\n\<\/body\> ./FILE.html
Apologies for the previous noise, and thank you for the thoughtful responses.
--Chris
Yes. What say about me, is true.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Perl RE; how to capture, and replace based on a block?
by hdb (Monsignor) on Dec 18, 2013 at 07:29 UTC | |
by taint (Chaplain) on Dec 18, 2013 at 07:51 UTC | |
Re^3: Perl RE; how to capture, and replace based on a block?
by QM (Parson) on Dec 19, 2013 at 09:41 UTC |
In Section
Seekers of Perl Wisdom