in reply to strings that dont contain
Is this what you mean?
#!/usr/bin/perl -w ######################### use strict; while (my $line=<DATA>) { chomp $line; unless ( $line =~ /2003/ ) { $line =~ s/($line)/$1 2003/; } print $line,"\n"; } __END__ Copyright 2001 Copyright 2001-2003 Copyright 2001,2002,2003 Copyright 1999-2001
When run yields:
--$ perl tack_on.pl Copyright 2001 2003 Copyright 2001-2003 Copyright 2001,2002,2003 Copyright 1999-2001 2003
| Peter L. Berghold | Brewer of Belgian Ales |
| Peter@Berghold.Net | www.berghold.net |
| Unix Professional | |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: strings that dont contain
by jc23 (Acolyte) on Jul 24, 2003 at 20:02 UTC |