[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Modifying multiple lines



I'm writing a script to modify the bookmark.htm file. Essentially I'm
looking for this inserted line from a previous script.

    <DT><H3 ADD_DATE="0">My Old Bookmarks</H3>
    <DL><p>
        <DT><H3 ADD_DATE="0">Old Folder1</H3>
    </DL><p>

I want to do a multi-line grab and delete it from the bookmark.htm file.
I've tried using the below script to accomplish this but it does not seem
to work right. Any ideas?

open(INFILE40,$bookmark_40) || die "Cannot open $bookmark_40 : $!\n";
undef $/;
while (<INFILE40>) {
	while (/<DT><H3 ADD_DATE="0">My Old
B(.*?)older1</H3>(.*?)</DL><p>/sm) {
		$array_40[$i] = "";
	}
}

Another problem I am having is that the line :

    </DL><p>

is repeated many times throughout the bookmark.htm file. How can I grab
just the four lines above and not the first line to the last </DL><p>? Any
help would be appreciated.

Thanks.

alan :)



===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org