Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I have an route endpoint like:
- my $self = shift();
- my $t = {
- id => $self->param('id'),
- attr => $self->param('attr'),
- title => $self->param('title'),
- body => $self->param('body'),
- };
- I expect it to end up like
- $t = {
- id => 123,
- attr => undef,
- title => 'Testing 1 2 3',
- body => 'Four score and...'
- };
- It actually ends up creating
- $t = {
- id => 123,
- attr => 'title',
- 'Testing 1 2 3' => 'body',
- 'Four score and...' => undef
- };
- with an "odd number of elements" warning
- Do I really have to do
- my $t = {
- id => $self->param('id') || undef,
- attr => $self->param('attr') || undef,
- title => $self->param('title') || undef,
- body => $self->param('body') || undef
- };
- just in case to prevent this behavior? This seems REALLY dangerous in conjunction with DBIx::Class and such.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement