#!/usr/bin/perl -w use strict; my $string = 'copyright 2000-2003'; $string .= ', 2003' if $string ~= /\b2003\b/;