Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

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 #!/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 $VAR1 = { 'one' => 'two' }; $ perl one=1 Odd number of elements in hash assignment at line 11. $VAR1 = { 'one' => '1', 'two' => undef }; $ perl two=2 Odd number of elements in hash assignment at line 11. $VAR1 = { 'one' => 'two', '2' => undef }; $ perl 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') );


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://574869]
[davies]: LanX: No. The mayor of London would better be described as the transport commisar for London. S/h/it doesn't have a tenth of the power of La Sturgeon (and therefore does <10% of the damage).
[LanX]: xD ... complicated countrie(s)
LanX reigned by the Duke of Normandy
[davies]: LanX: Politicians making jobs for each other, really. Results in unnecessary complications and tax bills with up to 5 levels of Govt busily inventing new crimes for people to commit.

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (9)
As of 2017-12-15 18:22 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (441 votes). Check out past polls.