We generally avoid inline assignments as they are fickle and prone to error. As an example this will fail if $indexPos == 0.