Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

CGI::Prototype puts an array ref in html form?

by bcp (Initiate)
on Sep 12, 2005 at 17:05 UTC ( #491316=perlquestion: print w/replies, xml ) Need Help??
bcp has asked for the wisdom of the Perl Monks concerning the following question:

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>
  • Comment on CGI::Prototype puts an array ref in html form?

Replies are listed 'Best First'.
Re: CGI::Prototype puts an array ref in html form?
by merlyn (Sage) on Sep 12, 2005 at 17:09 UTC
    Ahh yes, the freakin' end_form "feature" aka "bug".

    Replace self.CGI.end_form with self.CGI.end_form.join("") and blame either Lincoln Stein or Andy Wardley. Or me. Or all three of us. Or Canada.

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://491316]
Approved by Corion
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2017-09-24 17:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (274 votes). Check out past polls.

    Notices?