#!/usr/bin/perl -w use strict; my $string = 'copyright 2001, 2002'; if ( index($string,'2003') == -1 ) { $string .= ', 2003'; }