Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: DBIx::Class Pagination troubles

by haoess (Curate)
on Sep 26, 2006 at 07:12 UTC ( #574869=note: print w/ replies, xml ) Need Help??


in reply to DBIx::Class Pagination troubles

Don't use constructs as hash values, that could return empty lists:

$ cat test.pl #!/usr/bin/perl use warnings; use strict; use CGI; use Data::Dumper; my $q = CGI->new; my %h = ( one => $q->param('one'), two => $q->param('two') ); print Dumper \%h; __END__ $ perl test.pl $VAR1 = { 'one' => 'two' }; $ perl test.pl one=1 Odd number of elements in hash assignment at test.pl line 11. $VAR1 = { 'one' => '1', 'two' => undef }; $ perl test.pl two=2 Odd number of elements in hash assignment at test.pl line 11. $VAR1 = { 'one' => 'two', '2' => undef }; $ perl test.pl one=1 two=2 $VAR1 = { 'one' => '1', 'two' => '2' };

To use the $q->param("...") contruct as a hash value, force scalar context:

my %h = ( one => scalar $q->param('one'), two => scalar $q->param('two') );

--Frank


Comment on Re: DBIx::Class Pagination troubles
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://574869]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2014-12-28 13:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (181 votes), past polls