Dan Harbin wrote:
For instance, I want a column named "0" (the number zero).  While that
is valid as a mysql column, that is invalid as an attribute name.  The
only reason I can fathom that 0 is prohibited from being an attribute
name is because $obj->0 is invalid perl, but even so you can still
access the data via $meta or install another accessor which is valid
perl.

I had been under the impression that you can use any string for a Perl identifier as long as it was string-quoted (and maybe a certain no strict was in use?), and that limitations against say 0 names were more for bareword identifiers where they could be confused with numeric literals otherwise. Similar to how SQL does it.

I think it would be good to have the freedom to use any Perl string as an identifier, even if some such strings are discouraged by best practices, as sometimes that is useful, and Moose should support them if Perl itself does.

-- Darren Duncan

Reply via email to