in reply to Do not use diamond for STDIN
in thread Loop Control : REDO

Sir,
It seems like this may be a very desireable action at times. EG. in the case where you want a script to be interactive, but also have it cronned with all of the values for it in another file. In which case <> will do exactly what you want in both cases. Isn't this more a question of style that what SHOULD/SHOULDN'T be done?

-Fatty Lumpkin

Update: Merlyn is 1000% correct, poor reading on my part, i missed the actual printed prompt.I am just used to doing something like
shift || (print "\nprompt:" and <>);

But that doesn't allow for this behavior either.I missed the point, Thanks for correcting me.

Replies are listed 'Best First'.
Re: Re: Do not use diamond for STDIN
by merlyn (Sage) on Oct 29, 2001 at 23:52 UTC
    It seems like this may be a very desireable action at times. EG. in the case where you want a script to be interactive, but also have it cronned with all of the values for it in another file. In which case <> will do exactly what you want in both cases.
    In which case, you don't want to prompt, because then you get a bunch of prompts in the output, without responses. That... looks... tacky. I'd fatal that in a code review.

    -- Randal L. Schwartz, Perl hacker