I tried to fix all the things you suggested but i still get errors that dont make sence to me like:
C:\Perl>perl -cw create2.pl [Wed Aug 22 11:10:17 2001] (eval 1): Array found where operator expect +ed at (eva l 1) line 1, at end of line [Wed Aug 22 11:10:17 2001] (eval 1): (Do you need to predeclare Car +p::longmes s?) [Wed Aug 22 11:10:17 2001] (eval 1): Array found where operator expect +ed at (eva l 1) line 2, at end of line [Wed Aug 22 11:10:17 2001] (eval 1): (Do you need to predeclare Car +p::shortme ss?) [Wed Aug 22 11:10:17 2001] (eval 1): Array found where operator expect +ed at (eva l 1) line 3, at end of line [Wed Aug 22 11:10:17 2001] (eval 1): (Do you need to predeclare Car +p::shortme ss?) [Wed Aug 22 11:10:17 2001] (eval 1): Array found where operator expect +ed at (eva l 1) line 4, at end of line [Wed Aug 22 11:10:17 2001] (eval 1): (Do you need to predeclare Car +p::longmes s?) Undefined subroutine &Carp::longmess called at C:\PERL\lib/Carp.pm lin +e 296.
Lines one to four look fine to me? here is the revised code.
#!/usr/bin/perl -w #use CGI::Carp('fatalsToBrowser'); use Carp; use diagnostics; use strict; use warnings; my @pages=(); my @xfilenames=(); my @filenames=(); my @xtitles=(); my @titles=(); my @xheadings=(); my @headings=(); my @xstuff=(); my $xstuff=""; my @stuff=(); my @xtemplate=(); my $xtemplate=""; my @template=(); open(PAGES, "<pages.txt") || die $!; @pages = PAGES; close(PAGES); foreach $_ (@pages) { if (m/^\*{4}filename.ext\*{4}/) { push(@xfilenames, $_) } elsif (m/^\*{4}title\*{4}/) { push(@xtitles, $_) } elsif (m/^\*{4}heading\*{4}/) { push(@xheadings, $_) } else { push(@xstuff, $_) } } foreach $_ (@xfilenames) { s/^\*{4}filename.ext\*{4}//; chomp ($_); push(@filenames, $_); } foreach $_ (@xtitles) { s/^\*{4}title\*{4}//; chomp ($_); push(@titles, $_); } foreach $_ (@xheadings) { s/^\*{4}heading\*{4}//; chomp ($_); push(@headings, $_); } $xstuff = join("", @xstuff); @stuff = $xstuff =~ /\*{4}stuff\*{4}(.*?)\*{4}endstuff\*{4}/sg; open(TEMPLATE, "<template.html") || die $!; @xtemplate = <TEMPLATE>; close (TEMPLATE); $xtemplate = join("", @xtemplate); @template = $xtemplate =~ /^(.*?)\*{4}filename.ext\*{4}/sg; push (@template, $xtemplate =~ /\*{4}filename.ext\*{4}(.*?)\*{4}title\ +*{4}/sg); push (@template, $xtemplate =~ /\*{4}title\*{4}(.*?)\*{4}headings\*{4} +/sg); push (@template, $xtemplate =~ /\*{4}headings\*{4}(.*?)/sg); for ($i=0; $i < (@filenames); $i++) { open(FILE, ">@filenames[$i]") || die $!; print FILE qq($temlate[0] $title[$i] $template[1] $heading[$i] $te +mplate[2] $stuff[$i] $template[3]); close(FILE); } print "Content-type:text/html\n\n"; print <<EndHTML; <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transisional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html> <head> <title>create</title> </head> <body> EndHTML foreach (@filenames) { print "$a <p>Name:$_</p>"; } print "<hr />"; foreach (@titles) { print "<p>Titles:$_</p>"; } print "<hr />"; foreach (@headings) { print "<p>Headings:$_</p>"; } print "<hr />"; foreach (@stuff) { print "<p>stuff:$_</p>"; } print <<EndHTML; </body> </html> EndHTML

In reply to errors revisited by maddfisherman

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.