#!/usr/bin/perl -w use strict; my $cmd; while ((print "enter cmd: "), $cmd= and $cmd !~/^\s*$/) { chomp $cmd; print "cmd was: $cmd\n"; } print "loop exited\n"; #### my $cmd=""; until ($cmd !~ /^\s*$/){print "enter cmd: "; $cmd=;} chomp $cmd; print "cmd was: $cmd\n";