I've got a strange problem .. inside a sub I've declared a variable as my with three possible values ..
1. 'limit $nmbr1,$nmbr2'
2. 'limit $nmbr2'
3. not defined/false/null .. whatever ..
Here is the code.
sub get_all_artid_from_kategoriid { my ($self) = shift; my (%params) = @_; my $LIMIT = 'limit ' . $params{'limitantal'} if (($params{'lim +itantal'}) && (!$params{'limitstart'})); $LIMIT = 'limit ' . $params{'limitstart'} . "," . $params{' +limitantal'} if (($params{'limitantal'}) && ($params{'limitstart'})); my $ORDNING = " order by $params{'order'} " if ($params{'order'}); my $GROUP = " group by $params{'groupby'} " if ($params{'groupb +y'}); print STDERR "LIMIT = $LIMIT || limitantal = $params{'limitantal'} +\n"; . some other code..... . }
The problem is that if I call the sub without the values 'limitstart' and 'limitantal' the STDERR row prints out
LIMIT = limit 20,20 || limitantal =
NOW comes the strange part ,, atleast for me....
If I change the code like this.
. . my $LIMIT; $LIMIT = 'limit ' . $params{'limitantal'} if (($params{'limita +ntal'}) && (!$params{'limitstart'})); $LIMIT = 'limit ' . $params{'limitstart'} . "," . $params{' +limitantal'} if (($params{'limitantal'}) && ($params{'limitstart'})); . .
Then the STDERR row prints out the following.
LIMIT = || limitantal =
Which I think the first code-example would do too..
Any ideas?? Am I still to tired? .. (GMT+1 = 11.34am)
Best regards
Jocke, Sweden
In reply to 'my' problems by jockel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |