in reply to pipe operator for windows

Have you tried:
use warnings;
?

As written, your code expects a parameter to be passed specifying what gets passed to the -i option (The interface name).

I suspect if that is not specified, you could get the error you are seeing.

So, in addition to BrowserUk's advice, please show the value of $input.(It should be printed as a part of the command line).

        "You're only given one little spark of madness. You mustn't lose it."         - Robin Williams