use strict; package DBI; my $fetchall_arrayref; our $ROWS_LIMIT; INIT { $ROWS_LIMIT = 10; $fetchall_arrayref = \&fetchall_arrayref; } no warnings; sub fetchall_arrayref { my ($sth, $slice, $max_rows) = @_; $max_rows = $ROWS_LIMIT unless defined $max_rows; $fetchall_arrayref->($sth, $slice, $max_rows); } 1;