#!/usr/bin/perl use warnings; print "Please enter your test pattern \n"; chomp($pattern = ); print "Please enter your test strings, 1 at a time,\n"; print "if a match occurs, your pattern will be echoed.\n"; while(<>){ # print if m!your pattern here!; print if m!$pattern!; }