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

Re: [MacPerl] Bad Subroutine



add } else { print FIRST $first_line} to the if block

At 1:21 PM -0500 6/26/98, Matt Kraft wrote:
>I have this subroutine in a program of mine for the web that's just not
>working.  What it's supposed to do is, open a file, find the line that
>reads <!--$first_next-->Not Posted Yet and then put
><!--$first_next-->$subject<!--end$first_next--> in it's place.  But
>instead, it prints <!--$first_next-->$subject<!--end$first_next--> and
>erases over everything else in file.  Anyone know how to fix this?  The
>subroutine is below.
>
>Matt Kraft
>
>sub first_prev_page {
>   open(FIRST,"$basedir/$mesgdir/$first_prev\.$ext") || die $!;
>   @first = <FIRST>;
>   close(FIRST);
>
>   open(FIRST,">$basedir/$mesgdir/$first_prev\.$ext") || die $!;
>   if ($followup == 0) {
>      foreach $first_line (@first) {
>         if ($first_line =~ /<!--$first_next-->Not Posted Yet/) {
>	print FIRST "<!--$first_next-->\n";
>	print FIRST "$subject\n";
>	print FIRST "<!--end$first_next-->\n";
>            }
>	}
>    }
>   close(FIRST);
>}
>
>
>
>***** Want to unsubscribe from this list?
>***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch


_______________________________________________________________________
Lawrence K. Pickett, Jr. Ed. D.                    Phone: (314) 516-6011
Assistant Director                                   Fax: (314) 516-6007
Office of Computing & Networking Services
University of Missouri-St. Louis          e-mail:Larry_Pickett@umsl.edu
8001 Natural Bridge Road, 451 CCB                Larry_Pickett@acm.org
St. Louis, MO 63121-4499



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch