[Maypole] further exploration of the error I posted

From: Dana Hudes (dhudes at hudes.org)
Date: Wed Feb 02 2005 - 03:48:19 GMT


so I have this short program to sanity-check the YAML:

use YAML qw(Dump Load LoadFile);
use Data::Dumper;
print Dumper(LoadFile("photogallery.yaml"));
print "\n";
print Dump(LoadFile("photogallery.yaml"));

the Dumper output looks quite reasonable on first glance.
However, on closer examination and comparison with the
docs of Maypole::Plugin::Untaint I see some slight difference
at the top level.

I also see a sequence difference: in the perldoc for Plugin::Untaint,
it shows setup invoked AFTER untaint. This makes little
sense, how can you establish constraints in CDBI if you
haven't built the tables yet! You can't very well build tables
w/o the DSN. The YAML shows the dsn section first, but
the perl for that version omits Loader.
Removing Loader from my code doesn't change the error message.

The difference I see in the data structure is that
in the POD for Maypole::Plugin::Untaint the perl version is
an array of hashes (since arguments to a method are in list context):
MyApp->config->untaint_columns(
    table1 => { html => [qw(name email)] },
    table2 => { printable => [qw(lalala)] }
);

However the resultant data structure of YAML is in hash context:
'untaint_columns' => {
'websites' => {
                                                 'html' => [
                                                             'site_name',
                                                             'subjects_template',
                                                             'gallery_template',
                                                             'css'
                                                           ],
                                                 'Filenames' => [
                                                                  'doc_root',
                                                                  'secured_root',
                                                                  'galleries_dir',
                                                                  'gallery_thumbs_path',
                                                                  'subject_thumbs_path',
                                                                  'gallery_list',
                                                                  'subject_list'
                                                                ],
                                                 'url' => [
                                                            'secured_url'
                                                          ]
                                               },
etc.
        }

Now, I found another reason I really don't like YAML:
Use of of white space to indicate hierarchy. The Filenames
was a few spaces left of its proper position
and that made a problem.
Say what you will, you wouldn't have such a problem with XML.

_______________________________________________
maypole mailing list
maypole at lists.netthink.co.uk
http://lists.netthink.co.uk/listinfo/maypole



This archive was generated by hypermail 2.1.3 : Thu Feb 24 2005 - 22:25:58 GMT