in reply to IO::Prompter return object

You can force stringification using "$ret", if that's what you're asking.

Replies are listed 'Best First'.
Re^2: IO::Prompter return object
by azadian (Beadle) on Feb 18, 2026 at 07:54 UTC

    Apparently not, as I'm using $ret in the second call to prompt, which crashes.

    Update:

    Ah, so I need the quotes. Thanks.



    Original content restored by janitors.

      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.