Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
oh great monks,
whilst trying to follow merlin's examples for CGI::Prototype (LM column #71), i noticed that the html being generated ended with array ref rather than the usual form endage:
Content-Type: text/html; charset=ISO-8859-1

<html><head></head><body>
<h1> Welcome! </h1>
Please enter your first and last name
<form method="post" action="" enctype="multipart/form-data">
<input type="text" name="first" tabindex="1"  />
<input type="text" name="last" tabindex="2"  />
<input type="submit" tabindex="3" name=".submit" /> ARRAY(0x105f5abc)
</body></html>

i've tried it under both cygwin and FC3, using the latest tt, CGI::Prototype, etc. any guidance would be appreciated.
-bcp-
do.pl
#! /usr/bin/perl -w
use diagnostics;
use strict;
use MyApp;
MyApp->activate;
MyApp.pm
package MyApp;
use base CGI::Prototype;
use MyApp::One;
sub dispatch {
  my $self = shift;
  return 'MyApp::One';
}
1;
MyApp/One.pm
package MyApp::One;
use base MyApp;
sub template { 'forms/the_form.tt' }
1;

forms/the_form.tt
[% self.CGI.header %]<html><head></head><body>
<h1> Welcome! </h1>Please enter your first and last name
[% self.CGI.start_form; self.CGI.textfield('first');
   self.CGI.textfield('last'); self.CGI.submit;
   self.CGI.end_form %]
</body></html>

In reply to CGI::Prototype puts an array ref in html form? by bcp

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, 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, 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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and not a whimper to be heard...

    How do I use this? | Other CB clients
    Other Users?
    Others chilling in the Monastery: (7)
    As of 2017-06-25 07:58 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      How many monitors do you use while coding?















      Results (564 votes). Check out past polls.