C:\Perl>perl -c create2.pl [Tue Aug 21 19:57:32 2001] (eval 1): Array found where operator expected at (ev l 1) line 1, at end of line [Tue Aug 21 19:57:32 2001] (eval 1): (Do you need to predeclare Carp::longme s?) [Tue Aug 21 19:57:32 2001] (eval 1): Array found where operator expected at (ev l 1) line 2, at end of line [Tue Aug 21 19:57:32 2001] (eval 1): (Do you need to predeclare Carp::shortm ss?) [Tue Aug 21 19:57:32 2001] (eval 1): Array found where operator expected at (ev l 1) line 3, at end of line [Tue Aug 21 19:57:32 2001] (eval 1): (Do you need to predeclare Carp::shortm ss?) [Tue Aug 21 19:57:32 2001] (eval 1): Array found where operator expected at (ev l 1) line 4, at end of line [Tue Aug 21 19:57:32 2001] (eval 1): (Do you need to predeclare Carp::longme s?) [Tue Aug 21 19:57:32 2001] Carp.pm: Subroutine import redefined at C:\PERL\lib/ GI/Carp.pm line 185. [Tue Aug 21 19:57:32 2001] Carp.pm: Subroutine realwarn redefined at C:\PERL\li /CGI/Carp.pm line 198. Undefined subroutine &Carp::longmess called at C:\PERL\lib/Carp.pm line 296. #### #!/usr/bin/perl -w print "Content-type:text/html\n\n"; use CGI::Carp('fatalsToBrowser'); use strict; use warnings; print "Content-type:text/html\n\n"; @pages=(); @filenames=(); @titles=(); @headings=(); @stuff=(); open(PAGES, ") { push(@pages, $_) } close(PAGES); foreach $_ (@pages) { if (m/^\*\*\*\*filename.ext\*\*\*\*/) { push(@xfilenames, $_) } elsif (m/^\*\*\*\*title\*\*\*\*/) { push(@xtitles, $_) } elsif (m/^\*\*\*\*heading\*\*\*\*/) { push(@xheadings, $_) } else { push(@xstuff, $_) } } foreach $_ (@xfilenames) { s/^\*\*\*\*filename.ext\*\*\*\*//; chomp ($_); push(@filenames, $_); } foreach $_ (@xtitles) { s/^\*\*\*\*title\*\*\*\*//; chomp ($_); push(@titles, $_); } foreach $_ (@xheadings) { s/^\*\*\*\*heading\*\*\*\*//; chomp ($_); push(@headings, $_); } $xstuff = join("", @xstuff); @stuff = $xstuff =~ /\*\*\*\*stuff\*\*\*\*(.*?)\*\*\*\*endstuff\*\*\*\*/sg; open(TEMPLATE, ") { push(@xtemplate, $_) } 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-1); $i++) { open(FILE, ">@filenames[$i]") or die; print FILE QQ($temlate[0] $title[$i] $template[1] $heading[$i] $template[2] $stuff[$i] $template[3]); close(FILE); } print < create EndHTML foreach (@filenames) { print "$a

Name:$_

"; } print "
"; foreach (@titles) { print "

Titles:$_

"; } print "
"; foreach (@headings) { print "

Headings:$_

"; } print "
"; foreach (@stuff) { print "

stuff:$_

"; } print < EndHTML