[html-formfu] Why does get_all_elements() return a fake element?

Ron Savage ron at savage.net.au
Thu Oct 9 00:58:47 BST 2008


Hi Folks

Running this (el.pl):

<==8><==>
#!/usr/bin/perl

use strict;
use warnings;

use HTML::FormFu;

# --------------

my($form) = HTML::FormFu -> new();

$form -> load_config_file('./el.yml');

my($element);

for $element (@{$form -> get_all_elements()})
{
	print "Name: ", ($element -> name() || 'N/A'), ". \n";
}
<==8><==>

against this:

<==8><==>
---
action: /contacts/person/add
auto_fieldset: 1
auto_id: %n
id: add_form

elements:
  - type: Hidden
    name: sid
<==8><==>

I get:

<==8><==>
ron at zoe:~/perl.modules/Local-Contacts/scripts$ ./el.pl
Name: N/A. 
Name: sid. 
<==8><==>

Curious.

-- 
Ron Savage
ron at savage.net.au
http://savage.net.au/index.html





More information about the HTML-FormFu mailing list