New to Perl and my limitations are frustrating. Any help is greatly appreciated.

Creating script which will:

1. Input a file and parse for test pattern match
2. Output the specific matched word to a variable
3. Run external windows program (nslookup) against the variable,
4. Parse output of nslookup for test pattern match
5. Output the specific matched word to a variable
6. Perform a substitution between the two variables
7. And then output the modified text into a file

echoing "This is a Machine: ford.com test" into the input.txt file

I"m doing something wrong with the printout because I keep receiving the following 

> 
> Useless use of string in void context at test21.pl line 38.  
> 
>  Non-authoritative answer: Use of uninitialized value $\_ in print at
>  test21.pl line 39.
> 
> 
> 

0

```
#!/bin/perl
use strict;
use warnings;
use Net::Nslookup;
use File::Copy;

sub host {
    my $result;
    my $node = shift;
    print system("nslookup $node.com | findstr ^Name: >> POOH");
    open( my $stuff, "<", "POOH" ) || die "Can't open input.txt: $!";
    while (<$stuff>) {
        if (/(Name:)(\s+)(\w+)/) {
            $result = $3;
        }
    }
    return $result;
}

my $captured;
my $captured2;
my $jeff;
my $in   = 'input.txt';
my $out  = 'output.txt';
my $test = 'test.txt';

copy( $in, $out ) || die "File cannot be copied.";
open OUTPUT, "< $out"  || die "Can't open input.txt: $!";
open TEST,   "> $test" || die "Can't open input.txt: $!";

while (<OUTPUT>) {    # assigns each line in turn to $_
    if (/(Machine:)(\s)(\w+)/) {
        $captured = $3;
        $jeff     = host($captured);
    }

    "s/$captured/$jeff/g";
    print TEST;

}

```