Article View: pl.comp.lang.perl
Article #1129pattern matching problem
From: Michael Lepine
Date: Wed, 18 Mar 1998 17:34
Date: Wed, 18 Mar 1998 17:34
32 lines
1944 bytes
1944 bytes
I am using the following code to limit an archive web site so that it
only contains the ten most recent feature entries.
while($_ = <IN>) {
if ($entry_area_flag) {
/^.*<li>.*?/i && do { # count list items in archive
$archive_entries++;
if ($archive_entries >= 10) {
next; # if 10 list items, don't
print
}
}
/^.*</ul>.*?/i && do { # end of archive list entries
undef $entry_area_flag;
print "Entries: $archive_entries\n" if
$DEBUG;
}
}
print FILE $_;
/^.*NEW_ARCHIVE_ENTRIES.*/ && do {
print FILE $New_Entry;
$archive_entries++;
$entry_area_flag = 1;
}
}
For some reason I get a syntax error with the second pattern matching
sequence in the code ( /^.*</ul>.*?/ ). No matter what I replace the
search pattern with, I get an error. Can someone please help me figure
out a way around this?
Mike
Technical Details
Message-ID:
<35100724.43AFC3CC@bellsouth.net>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!pingwin.icm.edu.pl!news.icm.edu.pl!fu-berlin.de!news.maxwell.syr.edu!cpk-news-hub1.bbnplanet.com!news.bbnplanet.com!newsfeed.atl.bellsouth.net!news3.atl.bellsouth.net.POSTED!not-for-mailShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!pingwin.icm.edu.pl!news.icm.edu.pl!fu-berlin.de!news.maxwell.syr.edu!cpk-news-hub1.bbnplanet.com!news.bbnplanet.com!newsfeed.atl.bellsouth.net!news3.atl.bellsouth.net.POSTED!not-for-mail Message-ID: <35100724.43AFC3CC@bellsouth.net> From: Michael Lepine <mlepine@bellsouth.net> Organization: BellSouth.net X-Mailer: Mozilla 4.04 [en]C-bls40 (WinNT; U) MIME-Version: 1.0 Newsgroups: pl.comp.lang.perl Subject: pattern matching problem Lines: 32 Date: Wed, 18 Mar 1998 17:34:36 GMT NNTP-Posting-Host: ba31.bellsouth.net NNTP-Posting-Date: Wed, 18 Mar 1998 12:34:36 EST Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit