move subroutine sival() out of readline loop