#!/usr/bin/perl use warnings; use strict; my ($regexp, $string); print "Enter a text to play with: "; while(<>) { $string = chomp($_); print "now write a regexp that matches part of the text\n"; $regexp = ; $regexp = chomp($regexp); if($string =~ $regexp) { print "We have a match: "; print $1; } print "Enter a new text: "; }