On Jun 30, Morgan said:
>I need to match some parts if a document. and store it in variables so
>I can send the matching string into more than one new file.
>while (<>) {
>$pub =~ if (/<pub>/i .. /<\/pub>/i )
>}
I think what you want to do here is:
while (<>) {
print if m!<pub>!i .. m!</pub>!i;
}
(Print to the proper filehandle, of course.) This means "print the line
if it is in between a line holding <pub> and a line holding </pub>.
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
I am Marillion, the wielder of Ringril, known as Hesinaur, the Winter-Sun.
Are you a Monk? http://www.perlmonks.com/ http://forums.perlguru.com/
Perl Programmer at RiskMetrics Group, Inc. http://www.riskmetrics.com/
Acacia Fraternity, Rensselaer Chapter. Brother #734
** Manning Publications, Co, is publishing my Perl Regex book **