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

[MacPerl] Perl problems



Ok.. I know this is a macperl only list and this is probably a more general
perl problem but Im getting kinda desperate.. (while on it can U recoment any
general perl discussion-lists?)
-- 
I have a problem with the following code:


$copy_file = "copyright.html";

print "Content-type: text/html\n\n";

open (INPUTFILE, "<:index.ihtml");
    
     while ($row = <INPUTFILE>)
      {

      # Strip eol chars:
      $row =~ s/([\n\r]+)$//g;

      $row =~ s/%copyright%/&DisplayFile($copy_file)/ge;

      print $row;
       }
     close (INPUTFILE);

sub DisplayFile
{
open (INPUTFILE2, "<:files:dih:@_");
    

      while ($row = <INPUTFILE2>)
      {
      print $row;
       }
     close (INPUTFILE2);

}

After the call to DisplayFile (s/%copyright%/&DisplayFile($copy_file)/ge;)
I get crap-characters (for example "1i").
Why?
Any help appreciated...
The resulting file of the complete script looks like this:

http://www.anders.nu/ih/ih.cgi?file=test.ihpl

(Look at "1=" that can be seen between the top banner and the logo for example)..

---------------------------------------------o00o-o00o--
   Anders Gardebring; CGI, Database, webdesign @
   http://www.nt.se/  ICQ UIN: 3767919; 
   Home: http://www.anders.nu/
--------------------------------------------------------

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