swinfosec
asked on
file conversion in perl
I am taking an input file with a list of names. then for every occurence of Clark Kent, I am switching it with SUPERMAN!!!. I have some simple code below. where am i going wrong?
#!/usr/bin/perl -w
open("name.txt", "<filename.in");
open("nameout.txt", ">filename.out");
while(<name.txt>)
{
my($line) = $_;
chomp($line);
if($name = Clark Kent)
{
$newnme = "SUPERMAN!!!";
my($first, $last) = split(//, $name);
$line = sprintf($name, $newnme );
}
}
close("name.txt");
close("nameout.txt");
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
if ($name eq "Clark Kent") {
}