#!/usr/bin/perl -w print “Write something: \n”; while (<>) { print; if ($_ =~ /aaa/){ exit; } }