venki has asked for the wisdom of the Perl Monks concerning the following question:


I Would like to know if there is a way that i can use perl in the interactive mode.

Ex: Enter the name: - the prompt should wait till i enter the value for it.

Please let me know if there is any other good method i can use

Replies are listed 'Best First'.
Re: interactive mode
by hotshot (Prior) on Jan 07, 2003 at 14:17 UTC
    I think you ment:
    print "Enter the name: "; while ($line = <STDIN>) { # do whatever you want, $line holds the user's input }
    all user's input until he presses the enter key is stored in $line. Please make your question a little clearer so we can help more

    Hotshot
      Thank You
      This is what i want. Sorry for not giving you clear cut idea about my issue.
Re: interactive mode
by derby (Abbot) on Jan 07, 2003 at 15:41 UTC
    Or if you need more interaction in your interactive mode, check out some of the Term::Readline modules.

    -derby

Re: interactive mode
by davorg (Chancellor) on Jan 07, 2003 at 14:11 UTC

    Does typing

    perl -de 0

    at your prompt do what you want? If it doesn't, you might like to consider making your question a little clearer.

    --
    <http://www.dave.org.uk>

    "The first rule of Perl club is you do not talk about Perl club."
    -- Chip Salzenberg

Re: interactive mode
by osama (Scribe) on Jan 08, 2003 at 04:09 UTC
    print "Enter the name:"; $name=<STDIN>; print "Enter the email:"; $email=<STDIN>;