4 More Discussions You Might Find Interesting
1. What is on Your Mind?
Admins...
I just lerve the pop-ups that appear whilst replying to someones post.
It reminds me of "Paperclip" from my MS Windows days... ;oDD
Love it, as it makes me smile, telling me I am creating a thread ATM... ;o)
Neat little addition/feature guys... (4 Replies)
Discussion started by: wisecracker
4 Replies
2. UNIX for Advanced & Expert Users
Hi,
While compiling an application on Solaris 10, I observe the following printout. The same compilation passed some time ago(but perhaps the compilers were different then! We are maintaining this product and lost track of previous changes).
... (1 Reply)
Discussion started by: smanu
1 Replies
3. UNIX for Dummies Questions & Answers
Hello,
I have HP-UX 11.x running and the screen turns green with white text from the start. Sometimes, more desirable, the screen will start off with the normal black and white text terminal, but out of nowhere it will go green. For instance, I started it up an hour ago and it was fine, I then... (2 Replies)
Discussion started by: sammy-e
2 Replies
4. What is on Your Mind?
Hey! (first post!)
Has anyone here ever played Dungeons and Dragons before? Well, this game, Legend of the Green Dragon, does have it's similiarities.. And is a great roleplaying environment..
I would really like to to get the community built up -- It's sort of difficult because this game... (1 Reply)
Discussion started by: programgeek
1 Replies
LEARN ABOUT DEBIAN
cgi::formbuilder::source
CGI::FormBuilder::Source(3pm) User Contributed Perl Documentation CGI::FormBuilder::Source(3pm)
NAME
CGI::FormBuilder::Source - Source adapters for FormBuilder
SYNOPSIS
# Define a source adapter
package CGI::FormBuilder::Source::Whatever;
sub new {
my $self = shift;
my $class = ref($self) || $self;
my %opt = @_;
return bless \%opt, $class;
}
sub parse {
my $self = shift;
my $file = shift || $self->{source};
# open the file and parse it, or whatever
my %formopt;
open(F, "<$file") || die "Can't read $file: $!";
while (<F>) {
# ... do stuff to the line ...
$formopt{$fb_option} = $fb_value;
}
# return hash of $form options
return wantarray ? %formopt : \%formopt;
}
DESCRIPTION
This documentation describes the usage of FormBuilder sources, as well as how to write your own source adapter.
An external source is invoked by using the "source" option to the top-level "new()" method:
my $form = CGI::FormBuilder->new(
source => 'source_file.conf'
);
This example points to a filename that contains a file following the "CGI::FormBuilder::Source::File" layout. Like with the "template"
option, you can also specify "source" as a reference to a hash, allowing you to use other source adapters:
my $form = CGI::FormBuilder->new(
fields => @fields,
source => {
type => 'File',
source => '/path/to/source.conf',
}
);
The "type" option specifies the name of the source adapter. Currently accepted types are:
File - CGI::FormBuilder::Source::File
In addition to one of these types, you can also specify a complete package name, in which case that module will be autoloaded and its
"new()" and "parse()" routines used. For example:
my $form = CGI::FormBuilder->new(
fields => @fields,
source => {
type => 'My::Source::Module',
somefile => '/path/to/source.conf',
}
);
All other options besides "type" are passed to the constructor for that source module verbatim, so it's up to you and/or the source module
on how these additional options should be handled.
SEE ALSO
CGI::FormBuilder, CGI::FormBuilder::Source::File,
REVISION
$Id: Source.pm 100 2007-03-02 18:13:13Z nwiger $
AUTHOR
Copyright (c) Nate Wiger <http://nateware.com>. All Rights Reserved.
This module is free software; you may copy this under the terms of the GNU General Public License, or the Artistic License, copies of which
should have accompanied your Perl kit.
perl v5.14.2 2011-09-16 CGI::FormBuilder::Source(3pm)