#!/usr/bin/perl -w use strict; my $match= "hi"; my $re= qr/($match)/; print "\$match is $match\n"; print "'chimp' matches (", 'chimp' =~ $re, ")\n"; $match= "lo"; print "\$match is $match\n"; print "'slow' matches (", 'slow' =~ $re, ")\n"; print "'chimp' matches (", 'chimp' =~ $re, ")\n";