in reply to Re: do-while loop question
in thread do-while loop question

Quite true. But then again, if you're only looking at the beginning of the string, chomping becomes superfluous, and you don't even need to spring a variable into existence:

print "Are you ready to proceed? [y/N]: "; <STDIN> !~ /^y/i and die "Ciao!\n";

I changed the structure of the second line because it seems to read better to me, don't shoot me, it's a question of style. So now we have one line down, two to go :)


print@_{sort keys %_},$/if%_=split//,'= & *a?b:e\f/h^h!j+n,o@o;r$s-t%t#u'

Replies are listed 'Best First'.
Re^3: do-while loop question
by Coruscate (Sexton) on Mar 13, 2003 at 22:11 UTC

    I can throw it down to one line :)

    print "Are you ready to proceed? [y/N]: " and <> =~ /^y/i or die "ciao +\n";


    If the above content is missing any vital points or you feel that any of the information is misleading, incorrect or irrelevant, please feel free to downvote the post. At the same time, please reply to this node or /msg me to inform me as to what is wrong with the post, so that I may update the node to the best of my ability.