in reply to Re^2: IO::Prompter return object
in thread IO::Prompter return object

Update: You have materially changed the post to which this post replies, that's not cool. See How do I change/delete my post?.

As ikegami said, you need to wrap the scalar in double quotes to explicitly force stringification. Literally "$ret".

$ perl -MIO::Prompter -e '$ret = prompt -num,"number:" ; prompt -num,- +def=>"$ret", "another:"' number: 42 another: 43


The way forward always starts with a minimal test.