Index: trunk/Changes
===================================================================
--- trunk/Changes	(revision 31)
+++ trunk/Changes	(revision 32)
@@ -12,4 +12,6 @@
     * added a !section directive that splits up a form into
       sub-tables with their own ids and captions
+    * fall through to CGI::FormBuilder builtin option lists
+      if @LIST does not match a list directive
     
 0.05 -  9 Nov 2004
Index: trunk/lib/Text/FormBuilder.pm
===================================================================
--- trunk/lib/Text/FormBuilder.pm	(revision 31)
+++ trunk/lib/Text/FormBuilder.pm	(revision 32)
@@ -57,5 +57,5 @@
     
     local $/ = undef;
-    open SRC, "< $filename";
+    open SRC, "< $filename" or croak "[Text::FormBuilder::parse_file] Can't open $filename: $!" and return;
     my $src = <SRC>;
     close SRC;
@@ -69,4 +69,7 @@
     # so it can be called as a class method
     $self = $self->new unless ref $self;
+    
+    # append a newline so that it can be called on a single field easily
+    $src .= "\n";
     
     $self->{form_spec} = $self->{parser}->form_spec($src);
@@ -105,7 +108,5 @@
     # expand groups
     my %groups = %{ $self->{form_spec}{groups} || {} };
-    
     for my $section (@{ $self->{form_spec}{sections} || [] }) {
-##         foreach (grep { $$_[0] eq 'group' } @{ $self->{form_spec}{lines} || [] }) {
         foreach (grep { $$_[0] eq 'group' } @{ $$section{lines} }) {
             $$_[1]{group} =~ s/^\%//;       # strip leading % from group var name
@@ -149,9 +150,7 @@
             $$_{options} = \@list;
         } else {
-##             #TODO: this is not working in CGI::FormBuilder
-##             # assume that the list name is a builtin 
-##             # and let it fall through to CGI::FormBuilder
-##             $$_{options} = $$_{list};
-##             warn "falling through to builtin $$_{options}";
+            # assume that the list name is a builtin 
+            # and let it fall through to CGI::FormBuilder
+            $$_{options} = $$_{list};
         }
     } continue {
@@ -168,5 +167,5 @@
     # TODO: configurable threshold for this
     foreach (@{ $self->{form_spec}{fields} }) {
-        $$_{ulist} = 1 if defined $$_{options} and @{ $$_{options} } >= 3;
+        $$_{ulist} = 1 if ref $$_{options} and @{ $$_{options} } >= 3;
     }
     
@@ -230,5 +229,5 @@
     my ($self, $package, $use_tidy) = @_;
 
-    croak 'Expecting a package name' unless $package;
+    croak '[Text::FormBuilder::write_module] Expecting a package name' unless $package;
     
     # automatically call build if needed to
