> > > What would be a more elegant (short) way to express the following:
....

> That doesn't do the same thing though because the default value of $choice
> is Y (in case of an empty line, or a line with spaces only). So, must
change
> this to:
>
> $choice = $1 || 'Y', last if $choice =~ /^\s*(N|Y?)\s*$/;

What about :

while(<>) {
    next if(/^[^ny\s]+$/) or $choice = /n/i ? 'N' : 'Y' and last;
    }

?

!c

C. Church
http://www.digitalKOMA.com/church/
http://www.DroneColony.com/


Reply via email to