Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: IO::Prompter return object

by ikegami (Patriarch)
on Feb 17, 2026 at 21:56 UTC ( [id://11167342]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11167342]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2026-04-19 21:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.