#!/usr/bin/perl use warnings; use strict; if (defined(my $line = <>)) { { last if $line =~/quit/; print "You entered: $line"; $line = <>; redo; } } print "Bye! \n";