sub lastRowNum { my ( $dbh, $table ) = @_; my ( $rowcount ) = $dbh->selectrow_array( "select count(*) from $table" ); return $rowcount; }