While list_to_pid/1
can indeed be used to construct a PID and use it to send messages its usage is discouraged:
This BIF is intended for debugging and for use in the Erlang operating system. It should not be used in application programs.
A better approach would be to save the PID when you start the process:
1> P = spawn(fun() -> receive _ -> ok end end).
<0.34.0>
2> P!hi.
hi