I have a script that is *supposed* to search a file and make certain
words that I have in an array uppercase. My brain is not grokking it.
Q1: What is wrong with my script (below)?
Q2: Can I update a file in place?
Q3: How do I run multiple things against one file in one script?
=== SCRIPT ===
#!/usr/bin/perl
use strict;
use warnings;
# variables
my $word = undef;
# setup the words to uppercase
my @words = qw/ Mary John Joe /;
open FILE, ">> NEW1 " or die "can't open FILE: $!";
while (<>) {
foreach $word (@words) {
$word = ~ tr /a-z/A-Z/;
print FILE;
}
}
# close the file
close (FILE);
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]