use v5.12; use warnings; STDOUT->autoflush; STDERR->autoflush; STDIN->autoflush; say "Give me a cookie: "; my $thing = readline(STDIN); $thing =~ /^(a )?cookie$/ or warn "That was no cookie."; say "Thanks and goodbye!"; die "exiting here";