R. Geoffrey Avery on 4 May 2005 13:34:31 -0000 |
Did you set @template just once at some point before the block of code you sent? If so it looks like you made the substitutions to @template for the first file, and then continued to use it for each other the others although you have already replaced ZCITY, ZSTATE, and ZZIP. So for all files other than the first one no substitutions are happening. This might fix it... my $line = join ("\n", @template); $line =~ s/ZCITY/$city/sg ; $line =~ s/ZSTATE/$state/sg ; $line =~ s/ZZIP/$zip/sg ; printf OF $line ; Now that it is all in one line you need the /s to get around the newlines and /g to get all of the changes. - Geoff PS. You can also get more interesting messages from die if you do not end the message with "\n". At 09:01 AM 5/4/2005, you wrote: I've written a short perl program for a friend to substitute city, state, and zip in a template file and write each file out with a new name. - **Majordomo list services provided by PANIX <URL:http://www.panix.com>** **To Unsubscribe, send "unsubscribe phl" to majordomo@lists.pm.org**
|
|