in reply to Why this script is not running on windows?

Please learn about the shell you're using. cmd.exe does not support multiline commands. You will need to fit the complete command on one line.

Also, cmd.exe does not know about single quotes. You will need to change the surrounding quotes to double quotes. This also means that you will need to change all inner double quotes to qq().

perl -ane "$s = qq(); foreach (@F) { /(\d+)-(\d+)/ and $2 - $1 >= 30 a +nd $s .= qq( $1-$2) }; print qq($F[0]$s\n) if $s" input.txt

Replies are listed 'Best First'.
Re^2: Why this script is not running on windows?
by abhikalrt53 (Novice) on Nov 01, 2016 at 10:29 UTC
    Perfect.. thanks Corion