On 18/03/10 13:56, Nahuel ANGELINETTI wrote:
> + if ( my $data = $sth->fetchrow_hashref ) {
> + return $data;
> + }else{
> + return undef;
> + }
Its not a good idea to to return undef explicitly.
If the routine is called in an array context you get an array with
one element ( i.e. [ undef, ] ). Better to just return; which returns
undef in a scalar context and an empty array in an array context. Makes
for dafer code.
Colin
--
Colin Campbell
Chief Software Engineer,
PTFS Europe Limited
Content Management and Library Solutions
+44 (0) 208 366 1295 (phone)
+44 (0) 7759 633626 (mobile)
[email protected]
skype: colin_campbell2
http://www.ptfs-europe.com
_______________________________________________
Koha-patches mailing list
[email protected]
http://lists.koha.org/mailman/listinfo/koha-patches