Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
what do these mean is there a problem with my cgi::carp module???
C:\Perl>perl -c create2.pl [Tue Aug 21 19:57:32 2001] (eval 1): Array found where operator expect +ed at (ev l 1) line 1, at end of line [Tue Aug 21 19:57:32 2001] (eval 1): (Do you need to predeclare Car +p::longme s?) [Tue Aug 21 19:57:32 2001] (eval 1): Array found where operator expect +ed at (ev l 1) line 2, at end of line [Tue Aug 21 19:57:32 2001] (eval 1): (Do you need to predeclare Car +p::shortm ss?) [Tue Aug 21 19:57:32 2001] (eval 1): Array found where operator expect +ed at (ev l 1) line 3, at end of line [Tue Aug 21 19:57:32 2001] (eval 1): (Do you need to predeclare Car +p::shortm ss?) [Tue Aug 21 19:57:32 2001] (eval 1): Array found where operator expect +ed at (ev l 1) line 4, at end of line [Tue Aug 21 19:57:32 2001] (eval 1): (Do you need to predeclare Car +p::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 lin +e 296.
heres the code that goes with it.
#!/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, "<pages.txt"); while(<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, "<template.html"); while(<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] $te +mplate[2] $stuff[$i] $template[3]); close(FILE); } 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 compilation errors??? by maddfisherman

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (4)
As of 2024-04-19 14:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found