Perl terminate command on handle close
===

I am new to Perl. I have the following code which reads output from the command 'some_command'. The 'some_command' is an ongoing process which keeps printing output until it is killed. I am wondering if I close the file handle or call on last, will it also terminate the 'some_command' process or it's possible that 'some_command' will keep running as an orphan process. I basically want to read output from the command until I find the line with /Output/ then terminates.

    my $mycommand = 'some_command';
    open IN, "$mycommand 123456 |" or die("Failed: $!");
    while(my $line = <IN> && !$stop) {
        if($line =~ /Output/) {
           # work is done
           last;
           $stop = 1;
        }
    }
    close IN;  