Answer:
See Explaination
Step-by-step explanation:
This assume that input is a file and is given on command line. Please note this will ot print lines with frederick as thats what I feel question is asking for
#!/usr/bin/perl -w
open(FILE, $ARGV[0]) or die("Could not open the file $ARGV[0]");
while ($line = <FILE>){
if($line=~/\s+fred\s+/)
{
print $line;
}
}
close(FILE);