Use local variable in chunk_from_str()